Skip to content

Commit 7561101

Browse files
perf(proxy-state-tree): single mutationtree in production
1 parent 6f30a70 commit 7561101

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ export class ProxyStateTree<T extends object> implements IProxyStateTree<T> {
8282
)
8383
}
8484
getMutationTree(): ITrackMutationTree<T> {
85+
if (IS_PRODUCTION) {
86+
return ((this as any).__cachedProductionTree =
87+
(this as any).__cachedProductionTree || new TrackMutationTree(this))
88+
}
89+
8590
const tree =
8691
this.cache.trackMutationTree.pop() || new TrackMutationTree(this)
8792

0 commit comments

Comments
 (0)