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.
@@ -118,22 +118,23 @@ function createDefaultStateManager() {
118
118
 
119
119
  var found;
120
120
  find(keys.split("."), state);
121
- return typeof found === "object" && found ? typeof structuredClone !== 'undefined' ? structuredClone(found) : (0, _utils.copyObject)(found) : 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
- return JSON.parse(JSON.stringify(state));
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
- return JSON.parse(JSON.stringify(state));
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) {
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "files": [
23
23
  "dist/*"
24
24
  ],
25
- "version": "1.0.67",
25
+ "version": "1.0.68",
26
26
  "main": "dist/server",
27
27
  "browser": "dist/client",
28
28
  "repository": {