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

x/acorn/utils.ts>createPromiseWithResolvers

A focused RESTful server framework for Deno 🌰🦕
Latest
function createPromiseWithResolvers
import { createPromiseWithResolvers } from "https://deno.land/x/acorn@1.1.1/utils.ts";

Creates a promise with resolve and reject functions that can be called.

Offloads to the native Promise.withResolvers when available.

Returns

{ promise: Promise<T>; resolve: (value: T | PromiseLike<T>) => void; reject: (reason?: any) => void; }