Answer the question
In order to leave comments, you need to log in
How to run saga-watcher so that its saga-worker will only execute other sagas after the previous one is completed?
There is a saga-watcher, it has a saga-worker that executes other sagas
An example of a saga-worker
yield takeLatest(Actions.GET_INFO_ABOUT_USER.TRIGGER, getInfoAboutUser)
function* getInfoAboutUser(
action: ReturnType<typeof GET_INFO_ABOUT_USER.trigger>,
): Generator<StrictEffect> {
try {
const { userId, value } = action.payload;
yield put(Actions.GET_USER_DATA.trigger(userId));
yield put(Actions.SET_USER_DATA_WITH_FETCH.trigger({ userId, value }));
} catch (e) {
console.log(e);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question