-
Notifications
You must be signed in to change notification settings - Fork 7.1k
EventEmitter#listeners & ScaleManager#listeners #6260
Copy link
Copy link
Closed
Labels
Description
Version
- Phaser Version:
Phaser v3.60.0-beta.12 (WebGL | Web Audio) - Operating system:
win10 - Browser:
Microsoft Edge 106.0.1370.34
Description
To avoid removing the event handler set by the system, so i remove the event listener according to the context object, but ScaleManager has a property names 'listeners', then:
TypeError: emitter.listeners is not a functionDo you think this is a problem that should be fixed?
Example Test Code
protected removeListener$$(emitter: EventEmitter, eventName: string | symbol, context: any) {
const count = emitter.listenerCount(eventName);
if (count > 0) {
const listeners = emitter.listeners(eventName);
for (const fn of listeners) {
emitter.removeListener(eventName, fn, context);
}
}
}Additional Information
Reactions are currently unavailable