Skip to content

Behavior

Behavior<TBehaviorEventType, TGuardResponse, TBehaviorEvent>: object

Defined in: behaviors/behavior.types.ts:313

Type Parameters

TBehaviorEventType extends BehaviorEvent["type"] = BehaviorEvent["type"]

TGuardResponse = true

TBehaviorEvent extends BehaviorEvent = PickFromUnion<BehaviorEvent, "type", TBehaviorEventType>

Type declaration

actions

actions: BehaviorActionIntendSet<TBehaviorEvent, TGuardResponse>[]

Array of behavior action sets.

guard?

optional guard: BehaviorGuard<TBehaviorEvent, TGuardResponse>

Predicate function that determines if the behavior should be executed. Returning a non-nullable value from the guard will pass the value to the actions and execute them.

on

on: TBehaviorEventType

The internal editor event that triggers this behavior.