Skip to content

@yantrix/automata v0.0.2Docs


Yantrix API / @yantrix/automata / TEventBusHandler

Type Alias: TEventBusHandler()<EventType, EventMetaType>

ts
type TEventBusHandler<EventType, EventMetaType>: (event) => TEventBusTask<EventType, EventMetaType>;

Handler function for the event bus that transforms emitted events to event bus tasks.

Type Parameters

EventType extends TAutomataBaseEventType

The type of the automata event.

EventMetaType extends { [K in EventType]: any } = Record<EventType, any>

The type of the metadata associated with each event.

Parameters

event: TAutomataEventMetaType<EventType, EventMetaType>

The event metadata.

Returns

TEventBusTask<EventType, EventMetaType>

The event bus task.