reading-notes

Class Thirty-Seven Notes (401)

Redux - Combined Reducers

Multiple Reducers Example1

  1. make a new state in the reducer

newState = {…state}; return newState

  1. make a new state in the action

state = {…state, property: action.payload} //desctructure the state object, and only alter the property of interest in that action

Redux Docs: Using Combined Reducers2

Redux Docs: Combined Reducer Syntax3

Back to main page

References

  1. https://www.youtube.com/watch?v=gBER4Or86hE 

  2. https://redux.js.org/usage/structuring-reducers/using-combinereducers/ 

  3. https://redux.js.org/api/combinereducers/