
- 1. Use a getters reducer to isolate the state shape
- More generally, even if each reducer guarantees its own local consistency, you can still end up with an inconsistent state by looking at the Redux state as a whole.
- As our application grew in complexity, and as we added more and more reducers, we found it increasingly difficult to guarantee that all reducers were working together correctly to create a consistent and valid state shape.
- The idea of the getters reducer is to create a centralized set of getters available to the entire application.
- We have found that simply glancing over a reducer’s implementation isn’t enough to understand the state shape that it is responsible for, so, we felt that some additional documentation was needed.

@MovioHQ: “5 useful tips for real-world #Redux 4. Catch and dispatch exceptions from reducers #reactjs” open tweet »