MCPcopy Index your code
hub / github.com/aikoven/typescript-fsa-redux-saga

github.com/aikoven/typescript-fsa-redux-saga @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
8 symbols 20 edges 2 files 1 documented · 12% updated 4y agov2.0.0 · 2019-09-14★ 614 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

TypeScript FSA utilities for redux-saga npm version Build Status

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 to true if you want to use started action as a trigger instead of an event. This is useful when using takeLatest/takeEvery and you want to avoid having to manually dispatch an extra trigger action. This way, you only have to manually dispatch an started action, and saga will dispatch done/failed upon finish.

Example:

// actions.ts
import actionCreatorFactory from 'typescript-fsa';

const actionCreator = actionCreatorFactory();

// specify parameters and result shapes as generic type arguments
export const doSomething =
  actionCreator.async<{foo: string},   // parameter type
                      {bar: number}    // result type
                     >('DO_SOMETHING');

// saga.ts
import {SagaIterator} from 'redux-saga';
import {call} from 'redux-saga/effects';
import {doSomething} from './actions';

const doSomethingWorker = bindAsyncAction(doSomething)(
  function* (params): SagaIterator {
    // `params` type is `{foo: string}`
    const bar = yield call(fetchSomething, params.foo);
    return {bar};
  },
);

function* mySaga(): SagaIterator {
  yield call(doSomethingWorker, {foo: 'lol'});
}

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 7
Interface 1

Languages

TypeScript100%

Modules by API surface

tests/index.ts4 symbols
src/index.ts4 symbols

For agents

$ claude mcp add typescript-fsa-redux-saga \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page