export default function* rootSaga() { try { yield fork(runProcesses); } catch (e) { console.error('[root-saga]: An Uncaught Error Occurred: ', e.message); } finally { if (yield cancelled()) { // Called when our root saga is cancelled, this probably means // we are being hot reloaded. } } }
function* fetchFromAPI(screenName) { try { const result = yield call(api.fetchDrawerItems, screenName); yield call(delay, 2000); if (result) { yield put(Actions.fetchDrawerItemsSuccess(result.title, result.items)); } } finally { if (yield cancelled()) { yield put(Actions.fetchDrawerItemsFail('Fetch cancelled!')); } } }
* updateFlow(): IterableIterator { const browser = yield getContext('browser'); if (browser) { // only update the weather in client side const weatherUpdateTime = yield getContext('weatherUpdateTime'); const timerChannel = yield call(timer, weatherUpdateTime || 180000); // 3 min try { do { // update current weather yield put(this.actions.current.fetch()); } while (yield take(timerChannel));// wait for the next tick } finally { if (yield cancelled()) { timerChannel.close(); } } } }
console.error('Error while awaiting startup: ', e.message); } finally { if (yield cancelled()) {
console.error(`[monitorTypes]: ${e.message}`); } finally { if (yield cancelled()) { console.info('MonitorTypes Cancelled: ', proc);
if (yield cancelled()) { browserHistory.push('/login')
function* fetchFromAPI(screenName) { try { const result = yield call(api.fetchDrawerItems, screenName); yield call(delay, 2000); if (result) { yield put(Actions.fetchDrawerItemsSuccess(result.title, result.items)); } } finally { if (yield cancelled()) { yield put(Actions.fetchDrawerItemsFail('Fetch cancelled!')); } } }