1. Split Reducer

  • Each Reducer is responsible for managing only its share of the global state. State parameters of each Reducer are different, corresponding to the part of state data it manages. We can also put the split Reducer into different files to keep it independent and dedicated to different data domains.
  • Redux provides combineReducers(). All combineReducers() does is generate a function that calls your series of reducer, Each Reducer selects a part of the state data according to their keys and processes it. This generated function then merges all the reducer results into the final Reducer function. You can then call the createStore method on the Reducer.

2. MapStateToProps, mapDispatchToProps

  • When mapStateToProps is not passed, it does not cause component UI updates when store changes.
  • When mapDispatchToProps is not passed, dispatch is injected into the component props by default.

If mapStateToProps or mapDispatchToProps passes ownProps, then both functions will be called when the component’s ownProps changes