Skip to content

Commit e2a74d0

Browse files
fix(proxy-state-tree): fix cleanup bug
1 parent 57b8f39 commit e2a74d0

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export class ProxyStateTree<T extends object> implements IProxyStateTree<T> {
8383
)
8484
}
8585
onRemoveProxy(cb: IRemoveProxyCallback) {
86-
const index = this.removeProxyCallbacks.push(cb) - 1
86+
this.removeProxyCallbacks.push(cb)
8787

8888
return () => {
89-
this.removeProxyCallbacks.splice(index, 1)
89+
this.removeProxyCallbacks.splice(this.removeProxyCallbacks.indexOf(cb), 1)
9090
}
9191
}
9292
removeProxy(path: string) {

0 commit comments

Comments
 (0)