File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
packages/node_modules/proxy-state-tree/src Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -386,7 +386,8 @@ export class Proxifier {
386386
387387 return value
388388 }
389- destroy ( ) {
390- this . proxyCache = null
389+ dispose ( ) {
390+ this . proxyCache = { }
391+ this . disposeRemoveProxy ( )
391392 }
392393}
Original file line number Diff line number Diff line change @@ -72,10 +72,6 @@ export class TrackStateTree<T extends object> implements ITrackStateTree<T> {
7272 return result
7373 }
7474 dispose ( ) {
75- if ( this . proxifier !== this . master . proxifier ) {
76- this . proxifier . destroy ( )
77- }
78-
7975 if ( ! this . callback ) {
8076 this . pathDependencies . clear ( )
8177
Original file line number Diff line number Diff line change @@ -125,6 +125,12 @@ export class ProxyStateTree<T extends object> implements IProxyStateTree<T> {
125125 this . cache . mutationTree . push ( tree . dispose ( ) )
126126 } else if ( tree instanceof TrackStateTree ) {
127127 this . cache . trackStateTree . push ( tree . dispose ( ) )
128+
129+ if ( tree . proxifier !== this . proxifier ) {
130+ tree . proxifier . dispose ( )
131+ }
132+
133+ tree . proxifier = this . proxifier
128134 }
129135 }
130136 onMutation ( callback : IMutationCallback ) {
Original file line number Diff line number Diff line change 11export interface IProxifier < T extends object > {
22 proxify ( state : T , path : string ) : T
33 trackPath ( path : string ) : void
4- destroy ( ) : void
4+ dispose ( ) : void
55}
66
77export interface IMutation {
You can’t perform that action at this time.
0 commit comments