Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno_sonic/deps.ts>deferred

Sonic search engine driver for Deno
Latest
function deferred
Re-export
import { deferred } from "https://deno.land/x/deno_sonic@0.1.0/deps.ts";

Creates a Promise with the reject and resolve functions placed as methods on the promise object itself. It allows you to do:

const p = deferred<number>();
// ...
p.resolve(42);