Best way to encapsulate a repeated large state update? #175
julianeden
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One issue I run into with pullstate that I haven't found a good solution to is when I want to set a significant amount of state based on the value of a piece of state that is being changed.
As always this is best shown by example.
If there are 5 places in my project where x, y, and z are updated as a result of
someStatechanging, then it's nice to put the update to x/y/z in a function instead of repeating that block 5 times. So say I have this:The issue is that I cannot do this, because I can't nest store update calls:
I haven't found a good workflow for this. Does anyone know of one?
Beta Was this translation helpful? Give feedback.
All reactions