Skip to content

EventSubscriber<T>

Allows attaching event handlers.

Type Parameters

T extends unknown[]

Properties

last?

ts
readonly optional last: [...T[]];

In case event was broadcast at least once, returns last payload; undefined otherwise.

Defined in

event.ts:17 ↗


subscribe()

ts
subscribe: (handler) => string;

Attaches specified handler for events emitted by this event instance.

Parameters

handler

The handler to attach.

Returns

string

Defined in

event.ts:12 ↗


unsubscribe()

ts
unsubscribe: (handler) => void;

Detaches specified handler from events emitted by this event instance.

Parameters

handler

The handler to detach.

Returns

void

Defined in

event.ts:15 ↗