我有传奇:
function* sagaA() { // accumulates all user requests
// do stuff
yield all(users.map((user) => call(sagaB, user));
yield put(SUCCESS ACTION);
}
function* sagaB(user) { // is responsible for single request
yield call(api, user);
// do stuff
}
function* watch() { // watches for the action
yield take('REQUEST', sagaA);
}
但是,在这种情况下,请求是并行的,它们没有排队。
问题:如何修改这个传奇,让它们被一一调用?