Skip to content

@epikodelabs/actionstack


@epikodelabs/actionstack / waitForBrowserIdle

Function: waitForBrowserIdle()

waitForBrowserIdle(timeout?): Promise<void>

Defined in: idle.ts:13

Waits until the browser reaches an idle slot.

This is a scheduler-level quiescence helper used by ActionStack's awaitStatePropagation option when callers prefer to defer resolution until the environment had a chance to flush visual/update work.

Resolution order:

  • requestIdleCallback when available
  • requestAnimationFrame as a frame-level fallback
  • setTimeout(..., 0) as the final universal fallback

Parameters

timeout?

number = 50

Returns

Promise<void>

Released under the GNU AGPL v3.