Skip to content
Version: xstate@5.0.0

StateMachine.microstep() method​

Determines the next state given the current state and event. Calculates a microstep.

Signature:

microstep(state: MachineSnapshot<TContext, TEvent, TActor, TTag, TOutput, TResolvedTypesMeta>, event: TEvent, actorCtx: AnyActorContext): Array<MachineSnapshot<TContext, TEvent, TActor, TTag, TOutput, TResolvedTypesMeta>>;

Parameters​

ParameterTypeDescription
stateMachineSnapshot<TContext, TEvent, TActor, TTag, TOutput, TResolvedTypesMeta>The current state
eventTEventThe received event
actorCtxAnyActorContext

Returns:

Array<MachineSnapshot<TContext, TEvent, TActor, TTag, TOutput, TResolvedTypesMeta>>