wait-for-event
Version:
Wait for events to be emitted.
17 lines (16 loc) • 704 B
TypeScript
import { EventEmitter, Callback } from './types';
/**
* Wait for events and errors to stop being emitted for a period of time
*
* The `callback` is called when:
* - no events or errors have been emitted for the specified period of time
*
* The `callback` is called with an array of errors, if any occurred
*
* @param event
* @param emitters
* @param period
* @param callback
*/
export declare function waitForLull<Event extends string>(event: Event, emitters: EventEmitter<Event>[], callback?: Callback): Promise<void>;
export declare function waitForLull<Event extends string>(event: Event, emitters: EventEmitter<Event>[], period?: number, callback?: Callback): Promise<void>;