使用 Redux 需要遵循的原则。
The state of your whole application is stored in an object tree within a single store.
好处是:
The only way to change the state is to emit an action, an object describing what happened.
好处是所有操作都有顺序,而且可被纪录、序列化、存储及后续追溯。
To specify how the state tree is transformed by actions, you write pure reducers.
好处显而易见,不加入副作用,才能保证整个 action 处理过程是稳定的。