Skip to main content

Class: EventSubscriber<E>

A typed container for subscribers interacting with the Event Bus.

Type parameters

Name
E

Constructors

constructor

new EventSubscriber<E>(bus): EventSubscriber<E>

Creates an instance of an EventSubscriber.

Type parameters

Name
E

Parameters

NameTypeDescription
busEventBusThe EventBus that is the parent of this instance.

Returns

EventSubscriber<E>

Defined in

src/sdk/data/EventSubscriber.ts:14

Methods

on

on<K>(topic): Consumer<E[K]>

Subscribes to a topic on the bus.

Type parameters

NameType
Kextends string

Parameters

NameTypeDescription
topicKThe topic to subscribe to.

Returns

Consumer<E[K]>

A consumer to bind the event handler to.

Defined in

src/sdk/data/EventSubscriber.ts:21