Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/froebel/promise.ts

A strictly typed utility library.
Go to Latest
import * as froebel from "https://deno.land/x/froebel@v0.21.3/promise.ts";

Variables

Creates a queue function that accepts a function as it's only parameter. When queue is invoked, the passed in function is executed after the last function passed to queue has finished executing. The queue function returns the result of the passed in function asynchronously.

Checks if value is not a promise.

Checks if value looks like a promise.

Turns a function accepting a callback into a function returning a promise. You can specify in which parameter (if any) the callback expects to receive a result and in which it expects an error. Pass null to resultIndex or errorIndex if no result or errors are passed to the callback. By default the first argument passed to the callback is interpreted as result and none of the arguments as error (if the function accepting the callback throws or rejects, that will still result in the promisified function rejecting).