4 ms·
I never put everything in the one-big-store that rules them all either, but you don't really need to do that. Alternatives: - internal state (sometimes useful
by mercurial 10y ago
I never put everything in the one-big-store that rules them all either, but you don't really need to do that.
Alternatives:
- internal state (sometimes useful, especially for small things that doesn't matter for your underlying data - eg, "is this part of the tree unfolded"). Preferably, with very little logic linked to that state. Note that it can bite you if you use something like redux-undo on your store and your internal state refers to the data controlled by the store.
- temporary stores (create a store with a callback function in an event handler, and feed it a callback that invokes an action on your main store)
- smaller, specialized stores that get a projection of the data of you main store (this gets a bit awkward with async actions)
I'm also trying to avoid fully-controlled text inputs with textareas, I use wrappers with local state which send their content via onBlur().