Interface NextEventAsPromiseOptions<EventMap, K>

interface NextEventAsPromiseOptions<EventMap, K> {
    abort?: Maybe<ReadonlyAbort>;
    filter?: null | ((event: EventMap[K]) => boolean);
    timeout?: number;
    timeoutMessage?: string;
}

Type Parameters

Properties

(Optional) If provided, will reject the promise if the signal is aborted.

filter?: null | ((event: EventMap[K]) => boolean)

(Optional) If provided, will only resolve if the event passes this predicate.

timeout?: number

If provided, the promise will reject after this duration, in seconds, if not resolved.

timeoutMessage?: string

The timeout message. If not provided will use DEFAULT_TIMEOUT_MESSAGE.