Skip to content

@ue-too/being / index / StateExtension

Type Alias: StateExtension<E, C, S, O> ​

StateExtension<E, C, S, O> = object

Defined in: expansion.ts:96

What extendState may add to or wrap on an existing state.

Type Parameters ​

E ​

E

C ​

C extends BaseContext

S ​

S extends string

O ​

O extends Partial<Record<keyof E, unknown>>

Properties ​

beforeExit()? ​

optional beforeExit: (context, stateMachine, to, inherited) => void

Defined in: expansion.ts:124

Wraps the inherited beforeExit; call inherited() to run the original.

Parameters ​

context ​

C

stateMachine ​

StateMachine<E, C, S, O>

to ​

S | "TERMINAL"

inherited ​

() => void

Returns ​

void


eventGuards? ​

optional eventGuards: Partial<EventGuards<E, S, C, Guard<C>>>

Defined in: expansion.ts:115

Event guards to add; merged over the inherited event guards.


eventReactions? ​

optional eventReactions: Partial<EventReactions<E, C, S, O>> | (inherited) => Partial<EventReactions<E, C, S, O>>

Defined in: expansion.ts:107

Reactions to add or override. Pass an object to merge over the inherited reactions, or a function that receives the inherited reactions so an override can wrap the original action.


guards? ​

optional guards: Guard<C>

Defined in: expansion.ts:113

Guards to add; merged over the inherited guards.


uponEnter()? ​

optional uponEnter: (context, stateMachine, from, inherited) => void

Defined in: expansion.ts:117

Wraps the inherited uponEnter; call inherited() to run the original.

Parameters ​

context ​

C

stateMachine ​

StateMachine<E, C, S, O>

from ​

S | "INITIAL"

inherited ​

() => void

Returns ​

void