How granular should your reducers be?
- I think this is going to depend on what you are building. If you can group updates together that are always going to happen together I think that is better than having two seperate actions that update each item every time. For instance when I add an item to my cart, I am also increasing the cart count by one.
Pro or Con – multiple reducers can “fire” when a commonly named action is dispatched
- I think this is a Pro, as you can specifically name your actions to trigger multiple reducuers when you want to, and use more stratigic action names when you want to avoid this.
Name a strategy for preventing the above
- Naming or tagging actions with the component or reducer state it is specifically updating.
store
- store is the term used by redux to describe where global state is held, this is what is ultimately passed to the provider at the top level of your react app, and contains a combination of state from all of your reducers.
combined reducers
- combined reducers is a method in redux that allows you to take multiple reducer methods for various states and reference them all through one reducers or rootReducers variable.