We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3119f41 commit 59bd17aCopy full SHA for 59bd17a
src/service-module/service-module.mutations.ts
@@ -253,13 +253,18 @@ export default function makeServiceMutations() {
253
`[${serverAlias}].byServicePath[${servicePath}]`
254
)
255
256
+ let item
257
+
258
if (Model) {
- var model = new Model(current, { clone: true })
259
+ item = new Model(current, { clone: true })
260
} else {
- var copyData = mergeWithAccessors({}, current)
261
+ const existingClone = state.copiesById[id]
262
263
+ item = existingClone
264
+ ? mergeWithAccessors(existingClone, current)
265
+ : mergeWithAccessors({}, current)
266
}
267
- let item = model || copyData
268
if (keepCopiesInStore) {
269
state.copiesById[id] = item
270
0 commit comments