Function on

  • Add a listener for a given event.

    Parameters

    • eventName: string | symbol

      The event name.

    • listener: Function

      The listener function.

    • Optionalcontext: any

      The context to invoke the listener with.

    Returns EventEmitter

    this.

    event.on

    me.event.on("event-name", myFunction, this);