redux-observable

  • Version 2.0.0
  • Published
  • 118 kB
  • 2 dependencies
  • MIT license

Install

npm i redux-observable
yarn add redux-observable
pnpm add redux-observable

Overview

RxJS based middleware for Redux. Compose and cancel async actions and more.

Index

Functions

function combineEpics

combineEpics: <T extends any, O extends T = T, S = void, D = any>(
...epics: Epic<T, O, S, D>[]
) => Epic<T, O, S, D>;
  • Merges all epics into a single one.

function createEpicMiddleware

createEpicMiddleware: <T extends any, O extends T = T, S = void, D = any>(
options?: Options<D>
) => EpicMiddleware<T, O, S, D>;

    function ofType

    ofType: <
    Input extends any,
    Type extends Input['type'],
    Output extends Input = Extract<Input, any>
    >(
    types_0: Type,
    ...types_1: Type[]
    ) => any;
    • Inferring the types of this is a bit challenging, and only works in newer versions of TypeScript.

      Parameter

      ...types One or more Redux action types you want to filter for, variadic.

    Classes

    class StateObservable

    class StateObservable<S> extends Observable<S> {}

      constructor

      constructor(input$: any, initialState: {});

        property value

        value: {};

          Interfaces

          interface Epic

          interface Epic<
          Input extends Action = any,
          Output extends Input = Input,
          State = any,
          Dependencies = any
          > {}

            call signature

            (
            action$: Observable<Input>,
            state$: StateObservable<State>,
            dependencies: Dependencies
            ): Observable<Output>;

              interface EpicMiddleware

              interface EpicMiddleware<T extends Action, O extends T = T, S = void, D = any>
              extends Middleware<{}, S, Dispatch<any>> {}

                method run

                run: (rootEpic: Epic<T, O, S, D>) => void;

                  Package Files (6)

                  Dependencies (2)

                  Dev Dependencies (32)

                  Peer Dependencies (1)

                  Badge

                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/redux-observable.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/redux-observable)
                  • HTML
                    <a href="https://www.jsdocs.io/package/redux-observable"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>