Skip to content

Commit a3ca5b9

Browse files
Merge pull request #1616 from kim-sung-jee/fix/load-event-listeners
fix(event-emitter): replace deprecated scanFromPrototype with getAllMethodNames
2 parents aca0b66 + d490596 commit a3ca5b9

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/event-subscribers.loader.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,16 @@ export class EventSubscribersLoader
5757
const { instance } = wrapper;
5858
const prototype = Object.getPrototypeOf(instance) || {};
5959
const isRequestScoped = !wrapper.isDependencyTreeStatic();
60-
this.metadataScanner.scanFromPrototype(
61-
instance,
62-
prototype,
63-
(methodKey: string) =>
60+
this.metadataScanner
61+
.getAllMethodNames(prototype)
62+
.forEach(methodKey =>
6463
this.subscribeToEventIfListener(
6564
instance,
6665
methodKey,
6766
isRequestScoped,
6867
wrapper.host as Module,
6968
),
70-
);
69+
);
7170
});
7271
}
7372

lib/interfaces/event-emitter-options.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ConstructorOptions } from 'eventemitter2';
22

33
/**
44
* Options for the `EventEmitterModule`.
5-
*
5+
*
66
* @publicApi
77
*/
88
export interface EventEmitterModuleOptions extends ConstructorOptions {

lib/interfaces/on-event-options.interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { OnOptions } from 'eventemitter2';
22

33
/**
44
* Options for the `@OnEvent` decorator.
5-
*
6-
* @publicApi
5+
*
6+
* @publicApi
77
*/
88
export type OnEventOptions = OnOptions & {
99
/**

0 commit comments

Comments
 (0)