We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b12a88 commit 1f19717Copy full SHA for 1f19717
packages/node_modules/overmind/src/index.ts
@@ -160,9 +160,14 @@ export class Overmind<Config extends Configuration> implements Configuration {
160
161
if (IS_PRODUCTION) {
162
let nextTick
163
- const flushTree = () => proxyStateTree.flush()
+ const flushTree = () => {
164
+ proxyStateTree.clearMutationTracking()
165
+ proxyStateTree.flush(true)
166
+ proxyStateTree.startMutationTracking()
167
+ }
168
+
169
this.proxyStateTree.addMutationListener(() => {
- clearTimeout(nextTick)
170
+ nextTick && clearTimeout(nextTick)
171
nextTick = setTimeout(flushTree, 0)
172
})
173
}
0 commit comments