function* reqSaga(requestChannel, sagaMiddleware){ while(true){ let {req, res, next} = yield take(requestChannel); yield fork(sagaMiddleware, req, res, next); } }
yield fork(function* () { while(true){ let hook = yield consume(channels.lifecycleHook);
// Individual exports for testing export function* defaultSaga() { const loadDataWatcher = yield fork(takeLatest, LOAD_DATA, loadData); // Suspend execution until location changes yield take(LOCATION_CHANGE); yield cancel(loadDataWatcher); }
function* defaultSaga() { const loadMenu = yield fork(takeLatest, MENU_FETCH, fetchMenu); const loadEnvironments = yield fork(takeLatest, ENVIRONMENTS_FETCH, fetchEnvironments); yield take(MENU_FETCH_SUCCEEDED); yield cancel(loadMenu); yield take(ENVIRONMENTS_FETCH_SUCCEEDED); yield cancel(loadEnvironments); }
export default function* home() { yield all([ fork(watchfetchHomeData), ]); }
/** * Watches for LOAD_REPOS actions and calls getRepos when one comes in. * By using `takeLatest` only the result of the latest API call is applied. */ export function* homeSagas() { yield fork(takeLatest, GET_NOTES, getNotes); yield fork(takeLatest, ADD_NOTE, addNote); yield fork(takeLatest, EDIT_NOTE, editNote); yield fork(takeLatest, DELETE_NOTE, deleteNote); }
yield fork(function* () { while(true){ let hook = yield consume(channels.lifecycleHook);
/** * Watches for LOAD_REPOS actions and calls getRepos when one comes in. * By using `takeLatest` only the result of the latest API call is applied. */ export function* homeSagas() { yield fork(takeLatest, GET_NOTE_GROUPS, getNoteGroups); yield fork(takeLatest, ADD_NOTE_GROUP, addNoteGroup); yield fork(takeLatest, EDIT_NOTE_GROUP, editNoteGroup); yield fork(takeLatest, DELETE_NOTE_GROUP, deleteNoteGroup); }
export default function* persist() { yield all([ fork(watchRehydrate), ]); }