Videos
I haven't worked much with state management, at my last job that was already done and the responsibility of a specific team.
I have read the Zustand documentation, but I am confused on other use cases then the most simple use case. Particularly how set() is supposed to work, and it's limits.
-
Zustand has an Immer middleware, but I have a hard time understanding what it does, and why I should use it over Immer directly. When I do use get() with immer, I keep getting errors from state being Writable and whatever I get() is the actual object, that can't be assigned to a Writable object.
-
Side Effects. One action might need to do both a get and several sets. Should they be in the same set()? Or chained? I might have to get() an object, update it, then add it's id to changedIds.
I've been trying to find tutorials and examples that show more complex use cases but I've had no luck so far.
Really greateful for any tips, particularly open source projects on GitHub.