wapplr 1.0.67 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/states.js +10 -7
- package/package.json +1 -1
package/dist/common/states.js
CHANGED
|
@@ -118,22 +118,23 @@ function createDefaultStateManager() {
|
|
|
118
118
|
|
|
119
119
|
var found;
|
|
120
120
|
find(keys.split("."), state);
|
|
121
|
-
return typeof found === "object" && found ?
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (typeof structuredClone !== 'undefined') {
|
|
125
|
-
return structuredClone(state);
|
|
121
|
+
return typeof found === "object" && found ? (0, _utils.copyObject)(found) : found;
|
|
126
122
|
}
|
|
127
123
|
|
|
128
124
|
try {
|
|
129
|
-
|
|
125
|
+
if (!cachedString) {
|
|
126
|
+
cachedString = JSON.stringify(state);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return JSON.parse(cachedString);
|
|
130
130
|
} catch (e) {
|
|
131
131
|
console.log(e);
|
|
132
132
|
state = {};
|
|
133
133
|
Object.keys(initialState).forEach(function (key) {
|
|
134
134
|
state[key] = initialState[key];
|
|
135
135
|
});
|
|
136
|
-
|
|
136
|
+
cachedString = JSON.stringify(state);
|
|
137
|
+
return JSON.parse(cachedString);
|
|
137
138
|
}
|
|
138
139
|
},
|
|
139
140
|
dispatch: function dispatch(action) {
|
|
@@ -143,6 +144,8 @@ function createDefaultStateManager() {
|
|
|
143
144
|
console.log(e);
|
|
144
145
|
}
|
|
145
146
|
|
|
147
|
+
cachedString = "";
|
|
148
|
+
|
|
146
149
|
try {
|
|
147
150
|
stateManager.runListeners(action);
|
|
148
151
|
} catch (e) {
|