Class: EventSubscriber<E>
Defined in: src/sdk/data/EventSubscriber.ts:8
A typed container for subscribers interacting with the Event Bus.
Type Parameters
Type Parameter |
---|
E |
Constructors
Constructor
new EventSubscriber<
E
>(bus
):EventSubscriber
<E
>
Defined in: src/sdk/data/EventSubscriber.ts:14
Creates an instance of an EventSubscriber.
Parameters
Parameter | Type | Description |
---|---|---|
bus | EventBus | The EventBus that is the parent of this instance. |
Returns
EventSubscriber
<E
>
Methods
on()
on<
K
>(topic
):Consumer
<E
[K
]>
Defined in: src/sdk/data/EventSubscriber.ts:21
Subscribes to a topic on the bus.
Type Parameters
Type Parameter |
---|
K extends string |
Parameters
Parameter | Type | Description |
---|---|---|
topic | K | The topic to subscribe to. |
Returns
Consumer
<E
[K
]>
A consumer to bind the event handler to.