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
Name | Type | Description |
---|---|---|
bus | EventBus | The EventBus that is the parent of this instance. |
Returns
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
Name | Type |
---|---|
K | extends string |
Parameters
Name | Type | Description |
---|---|---|
topic | K | The topic to subscribe to. |
Returns
Consumer
<E
[K
]>
A consumer to bind the event handler to.
Defined in
src/sdk/data/EventSubscriber.ts:21