Skip to content
Snippets Groups Projects
Unverified Commit 63fdb691 authored by erezmus's avatar erezmus Committed by GitHub
Browse files

ensure subscribe is awaited upon

parent 2f9ffc75
No related branches found
No related tags found
No related merge requests found
{
"name": "@libero/event-bus",
"version": "0.2.3",
"version": "0.2.4",
"description": "",
"main": "dist/index.js",
"scripts": {
......
......@@ -93,10 +93,7 @@ export default class RabbitEventBus extends EventBus implements EventPublisher,
}
public async subscribe(eventType: string, handler: (event: Event) => Promise<boolean>): Promise<number> {
// TODO: this should be fixed as part of refactor/reshape... add async/await for now
this.connector.map(async connector => {
await connector.subscribe(eventType, handler);
});
await this.connector.get().subscribe(eventType, handler);
// Add the subscription to the next connector's list of subscriptions
return this.subscriptions.push({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment