Skip to content

EventEmitter#listeners & ScaleManager#listeners #6260

@x-wk

Description

@x-wk

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 function

Do 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions