Skip to content

HistoryStateNodeConfig <TContext, TEvent>

Hierarchy

Index

Properties

optionalafter

after?: DelayedTransitions<TContext, TEvent, any, any, any, any>

The mapping (or array) of delays (in milliseconds) to their potential transition(s). The delayed transitions are taken after the specified delay in an interpreter.

optionalalways

always?: TransitionConfigOrTarget<TContext, TEvent, TEvent, any, any, any, any>

An eventless transition that is always taken when this state node is active.

optionaldescription

description?: string

A text description of the state node

optionalentry

entry?: any

The action(s) to be executed upon entering the state node.

optionalexit

exit?: any

The action(s) to be executed upon exiting the state node.

history

history: true | shallow | deep

Indicates whether the state node is a history state node, and what type of history: shallow, deep, true (shallow), false (none), undefined (none)

optionalid

id?: string

The unique ID of the state node, which can be referenced as a transition target via the #id syntax.

optionalinitial

initial?: undefined

The initial state transition.

optionalinvoke

invoke?: SingleOrArray<{ id?: string; input?: NonReducibleUnknown | Mapper<TContext, TEvent, NonReducibleUnknown, TEvent>; onDone?: SingleOrArray<TransitionConfigOrTarget<TContext, DoneActorEvent<any>, TEvent, any, any, any, any>>; onError?: SingleOrArray<TransitionConfigOrTarget<TContext, ErrorActorEvent<unknown>, TEvent, any, any, any, any>>; onSnapshot?: SingleOrArray<TransitionConfigOrTarget<TContext, SnapshotEvent<Snapshot<unknown>>, TEvent, any, any, any, any>>; src: string | AnyActorLogic; systemId?: string }>

The services to invoke upon entering this state node. These services will be stopped upon exiting this state node.

optionalmeta

meta?: any

The meta data associated with this state node, which will be returned in State instances.

optionalon

on?: TransitionsConfig<TContext, TEvent, any, any, any, any>

The mapping of event types to their potential transition(s).

optionalonDone

onDone?: undefined

The potential transition(s) to be taken upon reaching a final child state node.

This is equivalent to defining a [done(id)] transition on this state node's on property.

optionalorder

order?: number

The order this state node appears. Corresponds to the implicit document order.

optionaloutput

output?: NonReducibleUnknown | Mapper<TContext, TEvent, unknown, TEvent>

The output data sent with the "xstate.done.state.id" event if this is a final state node.

The output data will be evaluated with the current context and placed on the .data property of the event.

optionalparallel

parallel?: false

optionalparent

parent?: StateNode<TContext, TEvent>

optionalstates

states?: undefined

The mapping of state node keys to their state node configurations (recursive).

optionaltags

tags?: any

The tags for this state node, which are accumulated into the state.tags property.

target

target: undefined | string

A default target for a history state

optionaltype

type?: history | atomic | compound | parallel | final

The type of this state node:

  • 'atomic' - no child state nodes
  • 'compound' - nested child state nodes (XOR)
  • 'parallel' - orthogonal nested child state nodes (AND)
  • 'history' - history state node
  • 'final' - final state node