Skip to main content
Module

x/defer/src/defer.ts

Robust TypeScript API for deferred handling of Promises. Supports event listeners and custom state-specific callbacks.
Latest
import * as defer from "https://deno.land/x/defer@0.6.0/src/defer.ts";

Classes

Creates a Promise with reject and resolve functions placed as methods on the promise object itself. Also adds a state property, which will be either "pending", "settled" or "rejected". The state property can be "watched" for changes by assigning a function to onstatechange

Creates a Promise with reject and resolve functions placed as methods on the promise object itself. Also adds a state property, which will be either "pending", "settled" or "rejected". The state property can be "watched" for changes by assigning a function to onstatechange