From d3befc57b5fbd1b26cb88c5fca95ecd29654bb2b Mon Sep 17 00:00:00 2001 From: Josh Perez Date: Wed, 2 Sep 2015 21:48:50 -0700 Subject: [PATCH] Move hot-load delete up --- src/alt/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/alt/index.js b/src/alt/index.js index 5da27fe0..bb3e20c1 100644 --- a/src/alt/index.js +++ b/src/alt/index.js @@ -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( @@ -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)