interface IBaseBroker

export interface IBaseBroker<TEvents extends Record<string, any>>

Type Parameters

TEvents extends Record<string, any>

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

Subscribes to the given events, grouping them by the given group name

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

Unsubscribes from the given events - it's required to pass the same group name as when subscribing for proper cleanup