Skip to content

Commit

Permalink
fix(event-bus) force handler return to always be a promise, since rom…
Browse files Browse the repository at this point in the history
… don't accept undefined value
  • Loading branch information
s-montigny-desautels committed Jun 3, 2022
1 parent 6b8c2c6 commit b06109a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/event-bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class EventBus<EventBase extends IEvent = IEvent>
bind(handler: IEventHandler<EventBase>, id: string) {
const stream$ = id ? this.ofEventId(id) : this.subject$;
const subscription = stream$
.pipe(mergeMap((event) => from(handler.handle(event))))
.pipe(mergeMap((event) => from(Promise.resolve(handler.handle(event)))))
.subscribe({
error: (error) => {
this._logger.error(
Expand Down

0 comments on commit b06109a

Please sign in to comment.