TypeScript FSA utilities for redux-saga
Installation
npm install --save typescript-fsa-redux-saga
API
bindAsyncAction(actionCreators: AsyncActionCreators, options?: BindAsyncActionOptions): HigherOrderSaga
Creates higher-order-saga that wraps target saga with async actions.
Resulting saga dispatches started
action once started and done
/failed
upon finish.
Options
skipStartedAction
: Set totrue
if you want to usestarted
action as a trigger instead of an event. This is useful when usingtakeLatest
/takeEvery
and you want to avoid having to manually dispatch an extra trigger action. This way, you only have to manually dispatch anstarted
action, and saga will dispatchdone
/failed
upon finish.
Example:
// actions.ts; ; // specify parameters and result shapes as generic type arguments // result type >'DO_SOMETHING'; // saga.ts;;; ;