Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2888f4c commit a87843dCopy full SHA for a87843d
src/state/store.js
@@ -33,10 +33,14 @@ class Store {
33
34
@action
35
initializeStores(state) {
36
+ const _state = _.isString(state)
37
+ ? JSON.parse(state)
38
+ : state;
39
+
40
Object.keys(this.$imports)
41
.forEach((key) => {
42
const StoreClass = this.$imports[key];
- const $state = state[key] || {};
43
+ const $state = _state[key] || {};
44
const $obj = new StoreClass($state);
45
const $extend = $obj.___extend || null;
46
Object.assign($obj, $state);
0 commit comments