-
Apologies in advance if this has been answered/documented before. I couldn't find an answer in the docs. Are reaction callbacks automatically run in (trans)actions? What I mean is, is this necessary? autorun(action(() => { /****/ }))
reaction(getDataFromState, action(data => { /****/ }))
when(predicate, action(() => { /****/ })) Or does this suffice? autorun(() => { /****/ })
reaction(getDataFromState, data => { /****/ })
when(predicate, () => { /****/ }) |
Beta Was this translation helpful? Give feedback.
Answered by
urugator
Apr 25, 2022
Replies: 1 comment 5 replies
-
yes
no
yes However you should avoid mutating state in reactions, therefore it shouldn't matter most of the time. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
kubk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yes
no
yes
However you should avoid mutating state in reactions, therefore it shouldn't matter most of the time.