Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Action<Instance, State, Payload>

Type parameters

  • Instance

  • State

  • Payload

Hierarchy

  • Action

Index

Constructors

constructor

Properties

Abstract from

from: State | string | (string | State)[]

Protected logger

logger: any

name

name: string

Protected options

options: ActionOptions

Abstract to

to: State | string | (string | State)[]

Methods

afterTransition

  • afterTransition(instance: Instance): void
  • Handles post transition results.

    Parameters

    • instance: Instance

      The state machine instance.

    Returns void

beforeTransition

  • beforeTransition(instance: Instance): void
  • Parameters

    • instance: Instance

      The state machine instance

    Returns void

matches

  • matches(from: "*" | State, to: "*" | State): boolean
  • Checks if action matches from/to state pair specified.

    Parameters

    • from: "*" | State

      The original state to be checked against.

    • to: "*" | State

      The destination state to be checked against.

    Returns boolean

onTransition

  • onTransition(instance: Instance, data: TransitionData<State, Payload>): Promise<boolean>
  • Handles a state transition

    Parameters

    • instance: Instance

      The state machine instance.

    • data: TransitionData<State, Payload>

      The transition payload passed to the fsm.goTo() method.

    Returns Promise<boolean>

Generated using TypeDoc