Skip to content

Commit b9e625e

Browse files
feat(proxy-state-tree): also handle delete mutation revert value
1 parent c843e41 commit b9e625e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/node_modules/proxy-state-tree/src/Proxyfier.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ export class Proxifier {
336336
path: nestedPath,
337337
args: [],
338338
hasChangedValue: true,
339+
revertValue: target[prop],
339340
},
340341
objectChangePath
341342
)

packages/node_modules/proxy-state-tree/src/index.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ describe('OBJECTS', () => {
242242
path: 'foo',
243243
args: [],
244244
hasChangedValue: true,
245+
revertValue: 'bar',
245246
},
246247
])
247248
expect(mutationTree.state.foo).toBe(undefined)

0 commit comments

Comments
 (0)