You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using mobx with mobx-state-tree, and for each MST node, an autorun created. I would like to either batch these autoruns together in a larger transaction, and or listen to batch starts and batch ends.
The ideal behavior is something like this
onBatchStart - suspend second state
autorun - compute and push results to second state
autorun - compute and push results to second state
autorun - compute and push results to second state
onBatchEnd - resume second state
The reason is that I'm trying to integrate mobx with another library that has batching via a suspend and resume API, and I'm trying to these two things together.
A hack I could do is
autorun - compute and push results to a central store
autorun - compute and push results to a central store
autorun - compute and push results to a central store
autorun on central store - batch results from central store to second state library
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using mobx with mobx-state-tree, and for each MST node, an autorun created. I would like to either batch these autoruns together in a larger transaction, and or listen to batch starts and batch ends.
The ideal behavior is something like this
The reason is that I'm trying to integrate mobx with another library that has batching via a suspend and resume API, and I'm trying to these two things together.
A hack I could do is
Beta Was this translation helpful? Give feedback.
All reactions