action设计原则文档 https://redux.js.org/tutorials/fundamentals/part-3-state-actions-reducers#designing-actions

对象格式

  1. type 消息名称
  2. payload 传入的参数
    1. {type: 'todos/todoAdded', payload: todoText}
    2. {type: 'todos/todoToggled', payload: todoId}
    3. {type: 'todos/colorSelected, payload: {todoId, color}}
    4. {type: 'todos/todoDeleted', payload: todoId}
    5. {type: 'todos/allCompleted'}
    6. {type: 'todos/completedCleared'}
    7. {type: 'filters/statusFilterChanged', payload: filterValue}
    8. {type: 'filters/colorFilterChanged', payload: {color, changeType}}

dispatch

组件中 dispatch派发

  1. onClick = (e) => {
  2. const action = {
  3. type: 'change_lang',
  4. payload: e.key
  5. }
  6. store.dispatch(action)
  7. }

redux-saga

Redux-SagaRedux 中间件 的形式而存在,主要是管理 Redux 应用程序中的副作用(Side Effects)
https://www.yuque.com/fe9/select/miya5f

redux-thunk的缺点
https://blog.csdn.net/liwusen/article/details/80980987