Function createStateMachineReducer

  • Creates an event reducer from a state machine defined as a dictionary see: EventStateMachineStructure

    Returns

    reducer function that process the next state based on current state and an event

    Type Parameters

    Parameters

    • stateMachine: Partial<Record<TState, Partial<Record<string | TInput["type"], TState>>>>

      a state machine defined as a dictionary

    Returns Reducer<TState, TInput>

Generated using TypeDoc