j-templates 8.0.9 → 8.0.10
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/Store/store.js
CHANGED
|
@@ -63,7 +63,6 @@ class Store {
|
|
|
63
63
|
this.UpdateRootObject(rootGroup[0].path[0], rootGroup);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
// protected SpliceRootMap(spliceResult: DiffSpliceResult) {
|
|
67
66
|
SpliceRootObject(rootPath, start, deleteCount, items) {
|
|
68
67
|
const rootObject = this.rootMap.get(rootPath);
|
|
69
68
|
observableNode_1.ObservableNode.ApplySplice(rootObject[rootPath], start, deleteCount, items, this.cloneData);
|
|
@@ -125,12 +125,13 @@ class StoreAsync extends store_1.Store {
|
|
|
125
125
|
* @returns The array of deleted elements.
|
|
126
126
|
*/
|
|
127
127
|
async Splice(key, start, deleteCount, ...items) {
|
|
128
|
+
items = (0, json_1.JsonDeepClone)(items);
|
|
128
129
|
return await this.queue.Next(async () => {
|
|
129
130
|
if (!this.Has(key))
|
|
130
131
|
throw "Key not found in store";
|
|
131
132
|
const spliceResult = await this.diff.SplicePath(key, start, deleteCount, items);
|
|
132
133
|
this.UpdateRootMap(spliceResult.diffResult);
|
|
133
|
-
this.SpliceRootObject(spliceResult.path[0], spliceResult.start, spliceResult.deleteCount,
|
|
134
|
+
this.SpliceRootObject(spliceResult.path[0], spliceResult.start, spliceResult.deleteCount, items);
|
|
134
135
|
return spliceResult.spliceResult;
|
|
135
136
|
});
|
|
136
137
|
}
|