Redux提供一些api来管理数据,并且只能通过它提供的方式来修改。Redux包括三个部分:store, action,reducer。

store:是一个规范的state,就像一个有条理的数据库,Redux将整个应用的state存储在唯一的store中。

action:是一个有属性的对象,用来描述发生了什么的对象,用dispatch(action)来触发,并且这是改变state的唯一方式。

reducer:是具体通过action更新state的那个函数,基本结构是,reducer(state, action) => newstate

相关文章:

  • 2021-09-21
  • 2022-12-23
  • 2021-11-20
  • 2021-07-02
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-04-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2021-11-27
  • 2022-12-23
  • 2021-12-02
  • 2021-04-06
相关资源
相似解决方案