Skip to content

Commit 01b9ca2

Browse files
fix(overmind): reactions should update tracking on reaction
1 parent 7f8e177 commit 01b9ca2

File tree

1 file changed

+15
-6
lines changed
  • packages/node_modules/overmind/src

1 file changed

+15
-6
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ import {
4949
EXECUTION,
5050
processState,
5151
isPromise,
52-
MODE_DEFAULT, MODE_TEST, MODE_SSR } from './utils'
52+
MODE_DEFAULT,
53+
MODE_TEST,
54+
MODE_SSR,
55+
} from './utils'
5356
import {
5457
operatorStarted,
5558
operatorStopped,
@@ -59,7 +62,6 @@ import {
5962
createOperator,
6063
} from './operator'
6164

62-
6365
export * from './types'
6466

6567
export { createOperator, createMutationOperator }
@@ -863,10 +865,17 @@ export class Overmind<ThisConfig extends IConfiguration>
863865
})
864866
} else {
865867
const tree = this.proxyStateTree.getTrackStateTree()
866-
tree.trackScope(
867-
() => stateCallback(tree.state),
868-
() => updateCallback(tree.state)
869-
)
868+
const updateReaction = () => {
869+
tree.trackScope(
870+
() => stateCallback(tree.state),
871+
() => {
872+
updateCallback(tree.state)
873+
updateReaction()
874+
}
875+
)
876+
}
877+
878+
updateReaction()
870879

871880
disposer = () => {
872881
tree.dispose()

0 commit comments

Comments
 (0)