vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Function resumeOnce

    Await an event from an emitter and resume once the event is emitted. If the event results any results they are returned as result of the promise. When the event returns a single result it is returned as single item, when the event emits

    Name of the event to listen to

    Emitter emitting the event

    Optional timeout in ms, if no event is emitted within the timeout an exception os thrown. Defaults to indefinitely

    • Type Parameters

      • A
      • E extends string | symbol = string

      Parameters

      • eventName: E
      • emitter: { once(eventName: E, listener: (arg: A) => any): any }
      • Optionaltimeout: number

      Returns Promise<A>

    • Type Parameters

      • A extends any[]
      • E extends string | symbol = string

      Parameters

      • eventName: E
      • emitter: { once(eventName: E, listener: (...arg: A) => any): any }
      • Optionaltimeout: number

      Returns Promise<A>