@odd-tools/triggered-promise
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

triggered-promise

A promise that could be triggered externally.

Installation

npm i @odd-tools/triggered-promise

Usage:

let triggeredPromise: TriggeredPromise<number> = new TriggeredPromise();
triggeredPromise.resolve(42);
//will be resolved with 42
const val = await triggeredPromise;

Documentation

resolve(value?: T | PromiseLike): void

Resolves the promise with a given value.

reject(reason?: any): void

Rejects the promise with a given reason

Readme

Keywords

Package Sidebar

Install

npm i @odd-tools/triggered-promise

Weekly Downloads

3

Version

1.0.4

License

ISC

Unpacked Size

4.42 kB

Total Files

6

Last publish

Collaborators

  • a.pilyak