Skip to content

Commit

Permalink
feat: use publisher from any bus
Browse files Browse the repository at this point in the history
  • Loading branch information
Sikora00 committed Jul 9, 2022
1 parent 4e0c1bf commit 33c85df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/command-bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class CommandBus<CommandBase extends ICommand = ICommand>
if (!handler) {
throw new CommandHandlerNotFoundException(commandId);
}
this.subject$.next(command);
this._publisher.publish(command);
return handler.execute(command);
}

Expand Down
2 changes: 1 addition & 1 deletion src/query-bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class QueryBus<QueryBase extends IQuery = IQuery>
throw new QueryHandlerNotFoundException(queryId);
}

this.subject$.next(query);
this._publisher.publish(query);
const result = await handler.execute(query);
return result as TResult;
}
Expand Down

0 comments on commit 33c85df

Please sign in to comment.