Skip to content

Commit

Permalink
Move hot-load delete up
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker committed Sep 3, 2015
1 parent 93a4bd6 commit d3befc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/alt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class Alt {
store.createStoreConfig(this.config, StoreModel)
const Store = store.transformStore(this.storeTransforms, StoreModel)

/*istanbul ignore next*/
if (module.hot) delete this.stores[key]

if (this.stores[key] || !key) {
if (this.stores[key]) {
utils.warn(
Expand All @@ -67,9 +70,6 @@ class Alt {
? store.createStoreFromClass(this, Store, key, ...args)
: store.createStoreFromObject(this, Store, key)

/*istanbul ignore next*/
if (module.hot) delete this.stores[key]

this.stores[key] = storeInstance
StateFunctions.saveInitialSnapshot(this, key)

Expand Down

0 comments on commit d3befc5

Please sign in to comment.