Skip to content

@ue-too/being / index / GuardEvaluation

Type Alias: GuardEvaluation()<Context> ​

GuardEvaluation<Context> = (context) => boolean

Defined in: interface.ts:463

Type Parameters ​

Context ​

Context extends BaseContext

Parameters ​

context ​

Context

Returns ​

boolean

Description ​

This is the type for the guard evaluation when a state transition is happening.

Guard evaluations are evaluated after the state has handled the event with the action. Guard evaluations can be defined in an array and the first guard that evaluates to true will be used to determine the next state.

Generic parameters:

  • Context: The context of the state machine. (which can be used by each state to do calculations that would persist across states)