Skip to content

MachineView

Defined in: core/machineView.ts:18

A machine’s state and transition checks, as returned by useStateMachine, useMachines and useLocalActions().getMachine.

The fields describe the render: they’re what the component shows. The methods check against the latest state when called, so an event handler asks the same question the transition it’s about to dispatch will.

PropertyTypeDescriptionDefined in
allowedTransitionsstring[]Modes the current mode declares it can move to (invariants not checked).core/machineView.ts:24
currentModestringThe current mode, or the definition’s initialState before the first transition.core/machineView.ts:20
errorstring | undefinedThe last rejected transition’s message; cleared by the next successful one.core/machineView.ts:22

canTransitionTo(targetMode): boolean

Defined in: core/machineView.ts:26

Whether a transition to targetMode would be accepted right now.

ParameterType
targetModestring

boolean


validateTransition(targetMode): TransitionResult

Defined in: core/machineView.ts:28

The full result a transition to targetMode would have right now.

ParameterType
targetModestring

TransitionResult