Class

Action

Action(action, parentState, enabledopt)

Represents an actionable operation within a state.
Constructor

# new Action(action, parentState, enabledopt)

Constructs a new Action instance.
Parameters:
Name Type Attributes Default Description
action ActionType.<TInputs> The action type definition.
parentState State The state this action belongs to.
enabled boolean <optional>
true Whether the action is enabled.

View Source lib/flow-api/State.ts, line 268

Classes

Action
Action

Methods

# static createDisabled(name, parentState) → {Action.<TInputs>}

Creates a disabled action instance.
Parameters:
Name Type Description
name string The name of the action.
parentState State The state this action belongs to.

View Source lib/flow-api/State.ts, line 511

A disabled action instance.
Action.<TInputs>

# async run(inputValuesopt, configopt) → {Promise.<AnyState>}

Executes the action, transitioning to a new state.
Parameters:
Name Type Attributes Default Description
inputValues ExtractInputValues.<TInputs> <optional>
null Values for the action's inputs.
config ActionRunConfig <optional>
{} Configuration options.
dispatchAfterStateChangeEvent boolean <optional>
true Whether to dispatch an event after state change.

View Source lib/flow-api/State.ts, line 522

If the action is disabled or already invoked.
FlowError
A promise resolving to the next state.
Promise.<AnyState>