Type Alias EventGuards<EventPayloadMapping, States, Context, T>

EventGuards: {
    [K in keyof EventPayloadMapping]: GuardMapping<Context, T, States>[]
}

This is a mapping of a guard to a target state.

Generic parameters:

  • EventPayloadMapping: A mapping of events to their payloads.
  • States: All of the possible states that the state machine can be in. e.g. a string literal union like "IDLE" | "SELECTING" | "PAN" | "ZOOM"
  • Context: The context of the state machine. (which can be used by each state to do calculations that would persist across states)
  • T: The guard type.

You probably don't need to use this type directly. This is a mapping of an event to a guard evaluation.

Type Parameters