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

flatmap

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

Chain Async computations together.

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

const result = pipe(
  wrap(5),
  flatmap(n => wrap(n * 2))
);

const value = await result(); // 10
function flatmap<A, I>(fati: (a: A) => Async<I>): (ta: Async<A>) => Async<I>;
§
flatmap<A, I>(fati: (a: A) => Async<I>): (ta: Async<A>) => Async<I>
[src]

§Type Parameters

§Parameters

§
fati: (a: A) => Async<I>
[src]

§Return Type

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