StateConfig
One state of a machine, in XState’s shape, with wait beside it.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Context |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
description? |
string |
- |
entry? |
MachineAction<Context> | readonly MachineAction<Context>[] |
- |
exit? |
MachineAction<Context> | readonly MachineAction<Context>[] |
- |
history? |
HistoryDepth |
A history state’s depth: HistoryDepth.Deep goes back to the innermost state. |
initial? |
string |
The first of states it enters. |
on? |
Record<string, TransitionTarget<Context>> |
- |
states? |
Record<string, StateConfig<Context>> |
- |
target? |
string |
Where a history state goes when its parent has never been in. |
type? |
StateType |
XState’s kind of state, such as StateType.History. |
wait? |
WaitConfig<Context> |
Seconds this state holds before it goes to then. A state with a wait holds no states of its own. |
when? |
readonly WhenRule[] |
Moves on when a trait says so: each step, after the waits, the machine runs each test in order and moves to the target of the first that holds, a child state’s rules before its parent’s. A wait it enters counts that step’s seconds, as one a system’s send enters earlier in the step does. For what happens once, such as a hit, a system sends an event instead. |