IPubSubBroker

export interface IPubSubBroker<TEvents extends Record<string, any>> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents>>
export interface IPubSubBroker<TEvents extends Record<string, any>> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents>>

No summary provided.

Extends

IBaseBroker<TEvents>AsyncEventEmitter<ToEventMap<TEvents>>
NameConstraintsOptionalDefaultDescription
TEventsRecord<string, any>NoNone
publish(event, data):Promise<void>
Publishes an event
NameTypeOptionalDescription
eventTNoNone
dataTEvents[T]NoNone
subscribe(group, events):Promise<void>
Subscribes to the given events, grouping them by the given group name
NameTypeOptionalDescription
groupstringNoNone
events(keyof TEvents)[]NoNone
Inherited from IBaseBroker
unsubscribe(group, events):Promise<void>
Unsubscribes from the given events - it's required to pass the same group name as when subscribing for proper cleanup
NameTypeOptionalDescription
groupstringNoNone
events(keyof TEvents)[]NoNone
Inherited from IBaseBroker