redux-saga/effects#takeLeading TypeScript Examples

The following examples show how to use redux-saga/effects#takeLeading. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: deep-restorer.ts    From marina with MIT License 5 votes vote down vote up
// watch for each START_DEEP_RESTORATION action
// if a restoration is not running: start restore all accounts
export function* watchStartDeepRestorer(): SagaGenerator {
  yield takeLeading(START_DEEP_RESTORATION, restoreAllAccounts);
}
Example #2
Source File: main.ts    From marina with MIT License 5 votes vote down vote up
// watch for every UPDATE_TAXI_ASSETS actions
// wait that previous update is done before begin the new one
function* watchUpdateTaxi(): SagaGenerator<void, void> {
  yield takeLeading(UPDATE_TAXI_ASSETS, fetchAndSetTaxiAssets);
}
Example #3
Source File: main.ts    From marina with MIT License 5 votes vote down vote up
// watch for every RESET actions
// run reset saga in order to clean the redux state
function* watchReset(): SagaGenerator<void, void> {
  yield takeLeading(RESET, reset);
}