1.0.0 • Published 10 months ago

@esfx/async-deferred v1.0.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
10 months ago

@esfx/async-deferred

The @esfx/async-deferred package provides the Deferred class, an async coordination primitive.

Overview

Installation

npm i @esfx/async-deferred

Usage

import { Deferred } from "@esfx/async-deferred";

const deferred = new Deferred();

// to resolve the deferred:
deferred.resolve(value);

// to reject the deferred:
deferred.reject(error);

// get the promise for the deferred:
deferred.promise;

API

You can read more about the API here.