Skip to main content
Module

x/fun/promise.ts>of

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

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

Examples

Example 1

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

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

Parameters

a: A | PromiseLike<A>

Returns

Promise<A>