Skip to content

StateMachineEvents

Defined in: StateMachine.ts:33

What a machine reports, typed with its own state names. Subscribe with StateMachine.on, or from a component with this.listen(machine, machine.events.entered, ...).

The payload carries the move and nothing else. Game data travels on game events emitted next to the go() call.

S extends string

readonly changed: EventToken<StateTransition<S>>

Defined in: StateMachine.ts:35

Once per completed transition, after every enter hook has run.


readonly entered: EventToken<StateEntered<S>>

Defined in: StateMachine.ts:37

Once per state becoming current, parent before child.


readonly exited: EventToken<StateExited<S>>

Defined in: StateMachine.ts:39

Once per state ceasing to be current, child before parent.

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.