@types/redux-mock-store

  • Version 1.0.6
  • Published
  • 4.84 kB
  • 1 dependency
  • MIT license

Install

npm i @types/redux-mock-store
yarn add @types/redux-mock-store
pnpm add @types/redux-mock-store

Overview

TypeScript definitions for redux-mock-store

Index

Functions

function createMockStore

createMockStore: <S, DispatchExts = {}>(
middlewares?: Redux.Middleware[]
) => MockStoreCreator<S, DispatchExts>;
  • Create Mock Store returns a function that will create a mock store from a state with the same set of set of middleware applied.

    Parameter middlewares

    The list of middleware to be applied. S The type of state to be held by the store. DispatchExts The additional Dispatch signatures for the middlewares applied.

Interfaces

interface MockStore

interface MockStore<S = any, A extends Redux.Action = Redux.AnyAction>
extends Redux.Store<S, A> {}

    method clearActions

    clearActions: () => void;

      method getActions

      getActions: () => any[];

        Type Aliases

        type MockGetState

        type MockGetState<S = {}> = (actions: Redux.AnyAction[]) => S;

          type MockStoreCreator

          type MockStoreCreator<S = {}, DispatchExts = {}> = (
          state?: S | MockGetState<S>
          ) => MockStoreEnhanced<S, DispatchExts>;

            type MockStoreEnhanced

            type MockStoreEnhanced<S = {}, DispatchExts = {}> = MockStore<S> & {
            dispatch: DispatchExts;
            };

              Package Files (1)

              Dependencies (1)

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.

              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/@types/redux-mock-store.

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