Skip to main content

Invariant

@rotorsoft/act-root


@rotorsoft/act-root / act/src / Invariant

Type Alias: Invariant<TState, TActor>

Invariant<TState, TActor> = object

Defined in: libs/act/src/types/action.ts:244

An invariant is a condition that must always hold true for a state.

Type Parameters

TState

TState extends Schema

State schema.

TActor

TActor extends Actor = Actor

Actor type extending base Actor.

Properties

description

description: string

Defined in: libs/act/src/types/action.ts:245


valid()

valid: (state, actor?) => boolean

Defined in: libs/act/src/types/action.ts:246

Parameters

state

Readonly<TState>

actor?

TActor

Returns

boolean