import { delay } from "https://deno.land/x/fun@v2.0.0/promise.ts";
Delay the resolution of an existing Promise. This does not affect the original promise directly, it only waits for a ms milliseconds before flatmaping into the original promise.
Examples
Example 1
Example 1
import { wrap, delay } from "./promise.ts";
import { pipe } from "./fn.ts";
// Waits 250 milliseconds before returning
const result = await pipe(
wrap(1),
delay(250),
); // 1