Skip to content

EventSubscriber<T>

Defined in: event.ts:9 ↗

Allows attaching event handlers.

Type Parameters

T extends unknown[]

Properties

last?

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

Defined in: event.ts:17 ↗

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


subscribe()

ts
subscribe: (handler) => string;

Defined in: event.ts:12 ↗

Attaches specified handler for events emitted by this event instance.

Parameters

handler

(...args) => void

The handler to attach.

Returns

string


unsubscribe()

ts
unsubscribe: (handler) => void;

Defined in: event.ts:15 ↗

Detaches specified handler from events emitted by this event instance.

Parameters

handler

(...args) => void

The handler to detach.

Returns

void