Skip to main content
Module

x/defer/mod.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/mod.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

Emitted when a Defer Promise instance is fulfilled.

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

Emitted when a Defer Promise instance is rejected.

Emitted when a Defer Promise instance is settled.

Emitted when a Defer Promise instance's state changes.