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)