Function eventStateMachine

  • Creates a function that once applied to a stream of events will reduce state and events over time similar to rxjs scan operator but will multicast values to subscribers

    Returns

    operator function to reduce state and events over time

    Type Parameters

    Parameters

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

      a state machine defined as a dictionary see: EventStateMachineStructure

    • initialState: TState

      state that will be reduced will the first event or state at time 0

    Returns OperatorFunction<TMessage, TState>

Generated using TypeDoc