The idea of a pure function comes from functional programming, and can be summarized as follows:
- Given the same arguments, a pure function always returns the same result
- Regardless of our application state, a pure function is able to execute
- Variables outside of a pure function's scope cannot be modified by it
These three principles correlate with three major parts of the Redux ecosystem: actions, reducers, and store.
Actions are how we can indirectly modify our read-only state. Reducers are the pure functions that perform that modification. The single store in Redux is where our state exists.