Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

delay

import { delay } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/async.ts";

Add a delay to an Async computation.

@example
import { delay } from "./async.ts";
import { wrap } from "./async.ts";
import { pipe } from "./fn.ts";

const delayed = pipe(
  wrap("Hello"),
  delay(1000)
);

// This will wait 1 second before resolving to "Hello"
const result = await delayed();
function delay(ms: number): <A>(ma: Async<A>) => Async<A>;
§
delay(ms: number): <A>(ma: Async<A>) => Async<A>
[src]

§Parameters

§
ms: number
[src]

§Return Type

§
<A>(ma: Async<A>) => Async<A>
[src]