A module for waiting for things to happen.
npm install @blackglory/wait-forsh
npm install --save @blackglory/wait-for
or
yarn add @blackglory/wait-for
`API
$3
`ts
function waitForDOMChanged(): Promies
`$3
`ts
function waitForAttached(...nodes: Node[]): Promise
`$3
`ts
function waitForDetached(...nodes: Node[]): Promise
`$3
`ts
function waitForElementsMatchingSelectorAttached(
selector: string
): Promise
`$3
`ts
function waitForAllElementsMatchingSelectorDetached(
selector: string
): Promise
`$3
`ts
function waitForEventTarget(
target: T
, event: string
, signal?: AbortSignal
): Promise
`$3
`ts
function waitForEventEmitter(
target: T
, event: string
, signal?: AbortSignal
): Promise
`$3
`ts
function waitForEmitter<
EventToArgs extends Record
, Event extends keyof EventToArgs
>(
target: Emitter
, event: Event
, signal?: AbortSignal
): Promise
`$3
`ts
function waitForDOMContentLoaded(): Promise
`$3
`ts
function waitForLoad(): Promise
`$3
`ts
function waitForComplete(): Promise
`$3
`ts
function waitForInteractiveOrComplete(): Promise
`$3
`ts
function waitForFunction(
fn: () => T | PromiseLike
, interval: number = 0
): Promise
`$3
`ts
function waitForTimeout(ms: number, signal?: AbortSignal): Promise
`$3
`ts
function waitForSchedule(timestamp: number, signal?: AbortSignal): Promise
`$3
`ts
function waitForStateChanged(): Promise
`$3
`ts
function waitForUrlChanged(): Promise
`$3
`ts
function waitForAllMacrotasksProcessed(): Promise
`$3
`ts
function waitForAllMicrotasksProcessed(): Promise
`$3
`ts
function waitForIdleCallback(options?: IdleRequestOptions): Promise
`$3
`ts
function waitForAnimationFrame(): Promise
`$3
`ts
function waitForVideoFrameCallback(
video: HTMLVideoElement
): Promise>
``