Go to Latest
method EventEmitter.once
import { EventEmitter } from "https://dotland.deno.dev/std@0.110.0/node/events.ts";

Creates a Promise that is fulfilled when the EventEmitter emits the given event or that is rejected when the EventEmitter emits 'error'. The Promise will resolve with an array of all the arguments emitted to the given event.

Parameters

emitter: EventEmitter | EventTarget
name: string

Returns

Promise<any[]>