function* fetchDrawerItems({ screenName }) { const task = yield fork(fetchFromAPI, screenName); const { routeName } = yield take(Actions.GO_TO); const isFetchingDrawerItems = yield select(Actions.isFetchingDrawerItems); if (routeName === 'DrawerClose' && isFetchingDrawerItems) { yield cancel(task); } }
function createAbortableSaga(saga) { if (process.env.NODE_ENV === 'development') { return function* main() { const sagaTask = yield fork(saga); yield take(CANCEL_SAGAS_HMR); yield cancel(sagaTask); }; } return saga; }
// Individual exports for testing export default function* defaultSaga() { const loadPluginsWatcher = yield fork(takeLatest, GET_PLUGINS, pluginsGet); yield fork(takeLatest, DOWNLOAD_PLUGIN, pluginDownload); yield take(LOCATION_CHANGE); yield cancel(loadPluginsWatcher); }
export default function* defaultSaga() { const loadPermissionsWatcher = yield fork(takeLatest, GET_PERMISSIONS, permissionsGet); const loadPoliciesWatcher = yield fork(takeLatest, GET_POLICIES, policiesGet); const loadRoleWatcher = yield fork(takeLatest, GET_ROLE, roleGet); yield fork(takeLatest, GET_USER, fetchUser); yield fork(takeLatest, SUBMIT, submit); yield take(LOCATION_CHANGE); yield cancel(loadPermissionsWatcher); yield cancel(loadPoliciesWatcher); yield cancel(loadRoleWatcher); }
export function* requestImage( action ) { const fetchImageTask = yield fork( fetchImage, action.payload.requestedImage ); // Cancels the load task if action type GIF_MODAL_CANCEL_REQUEST_IMAGE is dispatched yield take( GIF_MODAL_CANCEL_REQUEST_IMAGE ); yield cancel( fetchImageTask ); }
// 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); }
// Individual exports for testing export function* defaultSaga() { const loadRecordsWatcher = yield fork(takeLatest, LOAD_RECORDS, getRecords); const loudCountWatcher = yield fork(takeLatest, LOAD_COUNT, getCount); const deleteRecordWatcher = yield fork(takeLatest, DELETE_RECORD, deleteRecord); // Suspend execution until location changes yield take(LOCATION_CHANGE); yield cancel(loadRecordsWatcher); yield cancel(loudCountWatcher); yield cancel(deleteRecordWatcher); }
// Individual exports for testing export function* defaultSaga() { const loadDataWatcher = yield fork(takeLatest, FETCH_DATA, dataFetch); yield fork(takeLatest, DELETE_DATA, dataDelete); yield fork(takeLatest, SUBMIT, submitData); yield take(LOCATION_CHANGE); yield cancel(loadDataWatcher); }
export function* defaultSaga() { const loadRecordWatcher = yield fork(takeLatest, LOAD_RECORD, getRecord); const editRecordWatcher = yield fork(takeLatest, EDIT_RECORD, editRecord); const deleteRecordWatcher = yield fork(takeLatest, DELETE_RECORD, deleteRecord); // Suspend execution until location changes yield take(LOCATION_CHANGE); yield cancel(loadRecordWatcher); yield cancel(editRecordWatcher); yield cancel(deleteRecordWatcher); }
function* defaultSaga() { const loadExistanceTableWatcher = yield fork(takeLatest, CHECK_IF_TABLE_EXISTS, getTableExistance); const loadModelWatcher = yield fork(takeLatest, MODEL_FETCH, fetchModel); const loadSubmitChanges = yield fork(takeLatest, SUBMIT, submitChanges); yield take(LOCATION_CHANGE); yield cancel(loadExistanceTableWatcher); yield cancel(loadModelWatcher); yield cancel(loadSubmitChanges); }
function* fetchDrawerItems({ screenName }) { const task = yield fork(fetchFromAPI, screenName); const { routeName } = yield take(Actions.GO_TO); const isFetchingDrawerItems = yield select(Actions.isFetchingDrawerItems); if (routeName === 'DrawerClose' && isFetchingDrawerItems) { yield cancel(task); } }
// Individual exports for testing export function* defaultSaga() { const loadRecordsWatcher = yield fork(takeLatest, LOAD_RECORDS, getRecords); const loudCountWatcher = yield fork(takeLatest, LOAD_COUNT, getCount); const deleteRecordWatcher = yield fork(takeLatest, DELETE_RECORD, deleteRecord); // Suspend execution until location changes yield take(LOCATION_CHANGE); yield cancel(loadRecordsWatcher); yield cancel(loudCountWatcher); yield cancel(deleteRecordWatcher); }
function* defaultSaga() { const loadExistanceTableWatcher = yield fork(takeLatest, CHECK_IF_TABLE_EXISTS, getTableExistance); const loadModelWatcher = yield fork(takeLatest, MODEL_FETCH, fetchModel); const loadSubmitChanges = yield fork(takeLatest, SUBMIT, submitChanges); yield take(LOCATION_CHANGE); yield cancel(loadExistanceTableWatcher); yield cancel(loadModelWatcher); yield cancel(loadSubmitChanges); }
export default function* defaultSaga() { const loadPermissionsWatcher = yield fork(takeLatest, GET_PERMISSIONS, permissionsGet); const loadPoliciesWatcher = yield fork(takeLatest, GET_POLICIES, policiesGet); const loadRoleWatcher = yield fork(takeLatest, GET_ROLE, roleGet); yield fork(takeLatest, GET_USER, fetchUser); yield fork(takeLatest, SUBMIT, submit); yield take(LOCATION_CHANGE); yield cancel(loadPermissionsWatcher); yield cancel(loadPoliciesWatcher); yield cancel(loadRoleWatcher); }