Skip to content

Commit

Permalink
Merge pull request #1023 from FredericEspiau/fix/event-handler-suppor…
Browse files Browse the repository at this point in the history
…t-inheritance

fix(event-bus): support events extending a base class
  • Loading branch information
kamilmysliwiec authored Jun 14, 2022
2 parents 82ec275 + 04b41fe commit d6c176b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/decorators/events-handler.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { v4 } from 'uuid';
export const EventsHandler = (...events: IEvent[]): ClassDecorator => {
return (target: object) => {
events.forEach((event) => {
if (!Reflect.hasMetadata(EVENT_METADATA, event)) {
if (!Reflect.hasOwnMetadata(EVENT_METADATA, event)) {
Reflect.defineMetadata(EVENT_METADATA, { id: v4() }, event);
}
});
Expand Down

0 comments on commit d6c176b

Please sign in to comment.