Class TemplateStateMachine<EventPayloadMapping, Context, States>

This is the template for the state machine.

You can use this class to create a state machine. Usually this is all you need for the state machine. Unless you need extra functionality. To create a state machine, just instantiate this class and pass in the states, initial state and context.

createKmtInputStateMachine for an example of how to create a state machine.

Type Parameters

  • EventPayloadMapping
  • Context extends BaseContext
  • States extends string = "IDLE"

Hierarchy (View Summary)

Implements

Constructors

Properties

_context: Context
_currentState: States
_happensCallbacks: (
    event: keyof EventPayloadMapping,
    payload: EventPayloadMapping[keyof EventPayloadMapping],
    context: Context,
) => void[]
_stateChangeCallbacks: StateChangeCallback<States>[]
_statesArray: States[]

Accessors

Methods