Skip to main content

ActionHandler

@rotorsoft/act-root


@rotorsoft/act-root / act/src / ActionHandler

Type Alias: ActionHandler()<TState, TEvents, TActions, TKey>

ActionHandler<TState, TEvents, TActions, TKey> = (action, snapshot, target) => Emitted<TEvents> | Emitted<TEvents>[] | undefined

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

Handles an action, producing one or more emitted events.

Type Parameters

TState

TState extends Schema

State schema.

TEvents

TEvents extends Schemas

Event schemas.

TActions

TActions extends Schemas

Action schemas.

TKey

TKey extends keyof TActions

Action name.

Parameters

action

Readonly<TActions[TKey]>

snapshot

Readonly<Snapshot<TState, TEvents>>

target

Target

Returns

Emitted<TEvents> | Emitted<TEvents>[] | undefined