-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(event-bus): Use instanceof check for of type operator #1930
feat(event-bus): Use instanceof check for of type operator #1930
Conversation
@michaelbromley Is this feature set fine for now? |
Let me know what we need tests for when we've agreed on an api for the event bus. |
Hi, Thanks for your contribution :) I've spent a bit more time thinking about this. I'd like to only add the
As this is a new feature, it should be made against the For tests, you should add one or two tests to the |
@michaelbromley Please check and verify |
@@ -81,9 +81,27 @@ export class EventBus implements OnModuleDestroy { | |||
ofType<T extends VendureEvent>(type: Type<T>): Observable<T> { | |||
return this.eventStream.asObservable().pipe( | |||
takeUntil(this.destroy$), | |||
filter(e => (e as any).constructor === type), | |||
filter(e => e.constructor === type), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typecast doesn't seem to be needed.
Why are the jobs failing? |
The jobs are failing because of a config issue after I added the latest plugin - nothing to do with your code. Thanks very much for your contribution! |
No description provided.