reducer 和 saga 的顺序

Order of reducer and saga

当调度一个动作时,它到达减速器时的顺序是什么?保证传奇?

我可以依靠它吗

  1. 首先进入reducer
  2. 然后是传奇?

减速器:

 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);
}

是的。该动作首先击中 reducer,然后击中 Sagas。