import { wait } from "https://deno.land/x/fun@v2.0.0/promise.ts";
Create a Promise that resolve after ms milliseconds.
Examples
Example 1
Example 1
import { wait, map } from "./promise.ts";
import { pipe } from "./fn.ts";
const delayed = pipe(
wait(1000),
map(() => "Hello World"),
);
// After 1 second
const result = await delayed; // "Hello World"