# Function onOnce

- onOnce<T>(obj, eventName, listener): IHandle

- Listens for an emitted event from an object and executes a callback only once before removing the listener.

  #### Type Parameters

  - T extends Evented

  #### Parameters

  - obj: T

    The object to listen to.

  - eventName: EventNames<T>

    The name of the event to listen for.

  - listener: EventedCallback<T["@eventTypes"][EventNames<T>]>

    The callback to execute once the event is emitted.

  #### Returns IHandle