1.0.4 • Published 5 years ago

@odd-tools/triggered-promise v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago