Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IAsyncStateMachine<T>

The public APIs of the AsyncStateMachine

Type parameters

  • T

Hierarchy

  • IAsyncStateMachine

Implemented by

Index

Methods

gotoAsync

  • gotoAsync(newState: T): Promise<void>
  • Performs an async transition from the current state to the new state without checking if it is possible. Events ans hooks of involved states will be invoked.

    Can be used in both presence or absence of async hooks. If your hooks are sync you can consider using goto() instead.

    Parameters

    • newState: T

    Returns Promise<void>

initializeAsync

transitAsync

  • transitAsync(targetState: T): Promise<boolean>
  • Performs an async transition from the current state to the target state.

    Can be used in both presence or absence of async hooks. If your hooks are sync you can consider using transit() instead.

    Parameters

    • targetState: T

      The new state

    Returns Promise<boolean>

transitByNameAsync

  • transitByNameAsync(transitionName: string): Promise<boolean>
  • Performs an async transition from the current state to the first applicable state of the transition with the specified name.

    If multiple transition have the same name, the first applicable state is is picked up traversing transitions in order of declaration.

    If the transition has an array in "to" the first applicable state is is picked up.

    Can be used in both presence or absence of async hooks. If your hooks are sync you can consider using transitByName() instead.

    Parameters

    • transitionName: string

    Returns Promise<boolean>

Generated using TypeDoc