Function once

  • Add a one-time 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.once

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