Skip to content

Commit cc576e0

Browse files
fix(proxy-state-tree): avoid returning spliced array on dipsoing onMutation
1 parent c02667d commit cc576e0

File tree

1 file changed

+2
-1
lines changed
  • packages/node_modules/proxy-state-tree/src

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ export class ProxyStateTree<T extends object> implements IProxyStateTree<T> {
135135
onMutation(callback: IMutationCallback) {
136136
this.mutationCallbacks.push(callback)
137137

138-
return () =>
138+
return () => {
139139
this.mutationCallbacks.splice(this.mutationCallbacks.indexOf(callback), 1)
140+
}
140141
}
141142
forceFlush() {
142143
const emptyMutations = []

0 commit comments

Comments
 (0)