j-templates 7.0.23 → 7.0.25
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/Store/Tree/observableScope.js +2 -0
- package/Utils/json.js +6 -1
- package/package.json +1 -1
|
@@ -195,6 +195,8 @@ function UpdateValue(scope) {
|
|
|
195
195
|
const [value, emitters, calcFunctions] = WatchScope(scope);
|
|
196
196
|
if (scope.async) {
|
|
197
197
|
scope.promise = value.then(function (result) {
|
|
198
|
+
if (scope.destroyed)
|
|
199
|
+
return;
|
|
198
200
|
scope.value = result;
|
|
199
201
|
emitter_1.Emitter.Emit(scope.emitter, scope);
|
|
200
202
|
return result;
|
package/Utils/json.js
CHANGED
|
@@ -46,9 +46,14 @@ function JsonDiffFactory() {
|
|
|
46
46
|
const typedSource = source;
|
|
47
47
|
const typedPatch = patch;
|
|
48
48
|
const sourceKeys = Object.keys(typedSource);
|
|
49
|
+
const targetKeys = Object.keys(typedPatch).filter(key => !sourceKeys.includes(key));
|
|
49
50
|
const result = {};
|
|
50
|
-
for (let x = 0; x < sourceKeys.length; x++)
|
|
51
|
+
for (let x = 0; x < sourceKeys.length; x++) {
|
|
51
52
|
result[sourceKeys[x]] = JsonMerge(typedSource[sourceKeys[x]], typedPatch[sourceKeys[x]]);
|
|
53
|
+
}
|
|
54
|
+
for (let x = 0; x < targetKeys.length; x++) {
|
|
55
|
+
result[targetKeys[x]] = typedPatch[targetKeys[x]];
|
|
56
|
+
}
|
|
52
57
|
return result;
|
|
53
58
|
}
|
|
54
59
|
default:
|