Options
All
  • Public
  • Public/Protected
  • All
Menu

Module store

Index

Start here Functions

Primary API Functions

Start here Functions

createStore

  • createStore<S, A>(initialState: S, logger?: Logger<S, A>): Store<S, A>
  • Create a Store for the State & Action types

    Type parameters

    Parameters

    • initialState: S

      Initial values of the state

    • logger: Logger<S, A> = ...

      The logging implementation (default provided)

    Returns Store<S, A>

Primary API Functions

Const reducerFromHandlers

  • Create a reducer by specifing reducer-per-action-type

    example
    const myReducer = reducerFromHandlers<MyState, MyAction>({
        myAction1: (state, action1) => state,
        myAction2: (state, action2) => state,
    });
    

    Type parameters

    • S

      State type

    • A: Action

      Action type

    Parameters

    Returns Reducer<S, A>

Generated using TypeDoc