Module

x/oak/util.ts>createPromiseWithResolvers

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Go to Latest
function createPromiseWithResolvers
import { createPromiseWithResolvers } from "https://dotland.deno.dev/x/oak@14.2.0/util.ts";

Offloads to the native Promise.withResolvers when available.

Currently Node.js does not support it, while Deno does.

Returns

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