import { until } from "https://deno.land/x/ayonli_jsext@v0.9.72/promise/index.ts";
Blocks the current routine until the test returns a truthy value, which is
not false
, null
or undefined
. If the test throws an error, it will be
treated as a falsy value and the check continues.
This functions returns the same result as the test function when passed.
Examples
Example 1
Example 1
import { until } from "@ayonli/jsext/async";
// wait for the header element to be present in the DOM
const ele = await until(() => document.querySelector("header"));