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

x/hex/src/data/deps.ts>mongo.Bson.deferred

An ecosystem delivering practices, philosophy and portability.
Go to Latest
function mongo.Bson.deferred
import { mongo } from "https://deno.land/x/hex@0.5.15/src/data/deps.ts";
const { deferred } = mongo.Bson;

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

    import { deferred } from "./deferred.ts";

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