减速机和传奇的顺序

时间:2016-07-27 08:31:40

标签: redux-saga

当调度动作是它到达减速器并保证传奇时的顺序?

我可以依靠吗

  1. 首先进入减速器
  2. 那么传奇?
  3. 减速机:

     function reducer(state, action) {
    
        switch (action.type) {
           case 'MY_ACTION':
           // decorate action so that an epic doesn't have to take data from store
           action.ports = state.itemsModified;                 
           return state;
         }
        }
    

    佐贺:

    export function* sagaUpdatePorts() {
        yield* ReduxSaga.takeEvery(actions.GRID_PORTS_ASYNC_UPDATE_PORTS, updatePorts);
    }
    
    function* updatePorts(action) {
        const {response, error} = yield SagaEffects.call(portsService.updatePorts, action.ports);
    }
    

1 个答案:

答案 0 :(得分:7)

是。该动作首先击中减速器,然后是Sagas。