From 63fdb69112532f88a93645bf6a7155e780b9b611 Mon Sep 17 00:00:00 2001 From: erezmus <e.odier@elifesciences.org> Date: Thu, 23 Jan 2020 11:37:27 +0000 Subject: [PATCH] ensure subscribe is awaited upon --- package.json | 2 +- src/rabbit-event-bus/index.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b45cc9d..199e2fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@libero/event-bus", - "version": "0.2.3", + "version": "0.2.4", "description": "", "main": "dist/index.js", "scripts": { diff --git a/src/rabbit-event-bus/index.ts b/src/rabbit-event-bus/index.ts index 0353959..2d13912 100644 --- a/src/rabbit-event-bus/index.ts +++ b/src/rabbit-event-bus/index.ts @@ -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({ -- GitLab