interface IPubSubBroker

extends

IBaseBroker<TEvents>AsyncEventEmitter<ToEventMap<TEvents>>
export interface IPubSubBroker<TEvents extends {}> extends IBaseBroker<TEvents>, AsyncEventEmitter<ToEventMap<TEvents>>

Type Parameters

TEvents extends {}

publish<

Event extends keyof TEvents

>(
event: Event
data: TEvents[Event]
) : Promise<void>

Publishes an event

subscribe(
events: (keyof TEvents)[]
) : Promise<void>

Subscribes to the given events

Inherited from: IBaseBroker

unsubscribe(
events: (keyof TEvents)[]
) : Promise<void>

Unsubscribes from the given events

Inherited from: IBaseBroker