Skip to main content
Module

x/fun/promise.ts>wrap

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 wrap
import { wrap } from "https://deno.land/x/fun@v2.0.0-alpha.12/promise.ts";

Create a Promise from a value A or another PromiseLike. This is essentially an alias of Promise.resolve.

Examples

Example 1

import { wrap } from "./promise.ts";

const result = await wrap(1); // 1

Parameters

a: A | PromiseLike<A>

Returns

Promise<A>