Interface: Publisher<E>
Defined in: src/sdk/data/EventBus.ts:55
An interface that describes an event publisher.
Type Parameters
Type Parameter |
---|
E |
Methods
pub()
pub<
K
>(topic
,data
,sync?
,isCached?
):void
Defined in: src/sdk/data/EventBus.ts:64
Publishes an event with data to a topic.
Type Parameters
Type Parameter |
---|
K extends string | number | symbol |
Parameters
Parameter | Type | Description |
---|---|---|
topic | K | The topic to publish to. |
data | E [K ] | The data to publish. |
sync? | boolean | Whether or the event should be synced to other event bus instances. Defaults to false . |
isCached? | boolean | Whether the event data should be cached. Cached data that are published to a topic can be retrieved by subscribers after the data was initially published. Defaults to true . |
Returns
void