在数据加入opRecord前进行克隆,减少了数据冗余

This commit is contained in:
Xu Chang 2023-03-31 14:43:04 +08:00
parent b4be92c785
commit 23b696a401
2 changed files with 6 additions and 6 deletions

View File

@ -1544,11 +1544,11 @@ var CascadeStore = /** @class */ (function (_super) {
var id = row.id;
if (!entityBranch_1[id]) {
Object.assign(entityBranch_1, (_a = {},
_a[id] = row,
_a[id] = (0, lodash_1.cloneDeep)(row),
_a));
}
else {
Object.assign(entityBranch_1[id], row);
Object.assign(entityBranch_1[id], (0, lodash_1.cloneDeep)(row));
}
}
});
@ -1568,7 +1568,7 @@ var CascadeStore = /** @class */ (function (_super) {
if (row) {
var id = row.id;
Object.assign(entityBranch, (_a = {},
_a[id] = row,
_a[id] = (0, lodash_1.cloneDeep)(row),
_a));
}
});

View File

@ -1573,11 +1573,11 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
const { id } = row;
if (!entityBranch![id!]) {
Object.assign(entityBranch!, {
[id!]: row,
[id!]: cloneDeep(row),
});
}
else {
Object.assign(entityBranch[id], row);
Object.assign(entityBranch[id], cloneDeep(row));
}
}
}
@ -1599,7 +1599,7 @@ export abstract class CascadeStore<ED extends EntityDict & BaseEntityDict> exten
if (row) {
const { id } = row as { id: string };
Object.assign(entityBranch!, {
[id!]: row,
[id!]: cloneDeep(row),
});
}
}