@ac-essentials/misc-util
    Preparing search index...

    Function waitFor

    • Waits until the provided condition function returns true.

      The condition function can be synchronous or asynchronous (returning a Promise). The function checks the condition at regular intervals specified by intervalMs.

      Note: This function shouldn't be used inplace of the vi.waitFor function from Vitest. This function is meant to be used in non-test code.

      Parameters

      • predicate: MaybeAsyncPredicate

        A function that returns a boolean or a Promise that resolves to a boolean.

      • Optionaloptions: WaitForOptions

        Options for configuring the wait behavior.

      Returns Promise<void>