wait
import { wait } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/promise.ts";Create a Promise that resolve after ms milliseconds that can also be disposed early.
@example
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"
function wait(ms: number): Promise<number> & Disposable;