Skip to main content
Module

x/fun/mod.ts>promise.then

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function promise.then
import { promise } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { then } = promise;

An alias for Promise.then

Examples

Example 1

import { of, then } from "./promise.ts";
import { pipe } from "./fn.ts";

const result = await pipe(
  of(1),
  then(n => n + 1),
); // 2

Parameters

fai: (a: A) => I | Promise<I>

Returns

(ua: Promise<A>) => Promise<I>