Skip to content

Interface: EventBus ​

Defined in: core/types.ts:72

A synchronous event bus that the effects and the plugins of a wand share.

Methods ​

emit() ​

ts
emit<K>(type, payload): void;

Defined in: core/types.ts:74

Sends the payload to each handler of the event type.

Type Parameters ​

Type Parameter
K extends "burst"

Parameters ​

ParameterType
typeK
payloadWandEvents[K]

Returns ​

void


on() ​

ts
on<K>(type, handler): () => void;

Defined in: core/types.ts:76

Adds a handler. Returns a function that removes the handler.

Type Parameters ​

Type Parameter
K extends "burst"

Parameters ​

ParameterType
typeK
handler(payload) => void

Returns ​

() => void