diff --git a/lib/event-subscribers.loader.ts b/lib/event-subscribers.loader.ts index 682d733a..fd11a155 100644 --- a/lib/event-subscribers.loader.ts +++ b/lib/event-subscribers.loader.ts @@ -50,16 +50,17 @@ export class EventSubscribersLoader const { instance } = wrapper; const prototype = Object.getPrototypeOf(instance) || {}; const isRequestScoped = !wrapper.isDependencyTreeStatic(); - this.metadataScanner - .getAllMethodNames(prototype) - .forEach(methodKey => + this.metadataScanner.scanFromPrototype( + instance, + prototype, + (methodKey: string) => this.subscribeToEventIfListener( instance, methodKey, isRequestScoped, wrapper.host as Module, ), - ); + ); }); }