Skip to main content
variable delay
import { delay } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Invokes the provided function after wait milliseconds.

Use setTimeout() to delay execution of fn. Use the spread (...) operator to supply the function with an arbitrary number of arguments.

type

(
fn: Func,
wait: number,
...args: any[],
) => unknown