react-redux Hook 使用、性能优化以及与 Vue 的对比
· 阅读需 6 分钟
redux
下图是 Redux 的工作流程图。
图中更新数据需要派发 Action,action 进入 dispatch,dispatch 中可能还会触发 action,比如使用 redux-thunk 中间件进行异步请求时,还会派发 action。然后 dispatch 函数会把 action 传递给 reducer 函数,reducer 用于状态的变更,状态变更后引起视图(View)更新。
