Skip to content

Commit 1f19717

Browse files
fix(overmind): fix production flushing
1 parent 7b12a88 commit 1f19717

File tree

1 file changed

+7
-2
lines changed
  • packages/node_modules/overmind/src

1 file changed

+7
-2
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,14 @@ export class Overmind<Config extends Configuration> implements Configuration {
160160

161161
if (IS_PRODUCTION) {
162162
let nextTick
163-
const flushTree = () => proxyStateTree.flush()
163+
const flushTree = () => {
164+
proxyStateTree.clearMutationTracking()
165+
proxyStateTree.flush(true)
166+
proxyStateTree.startMutationTracking()
167+
}
168+
164169
this.proxyStateTree.addMutationListener(() => {
165-
clearTimeout(nextTick)
170+
nextTick && clearTimeout(nextTick)
166171
nextTick = setTimeout(flushTree, 0)
167172
})
168173
}

0 commit comments

Comments
 (0)