Skip to main content
Module

x/fun/mod.ts>promise.wrap

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

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>