Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/retry/wait/wait.ts>waitUntilAsync

Re-execute a function until it does not throw an error or execute a function with a timeout.
Very Popular
Latest
function waitUntilAsync
import { waitUntilAsync } from "https://deno.land/x/retry@v2.0.0/wait/wait.ts";

wait for a function to complete within a givne duration or throw an exception.

Type Parameters

RETURN_TYPE

Parameters

fn: () => Promise<RETURN_TYPE>

the async function to execute

optional
duration: number = [UNSUPPORTED]

timeout in milliseconds

optional
error: Error = [UNSUPPORTED]