@thatsmrtalbot/waitforit
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Build Status

Typescript WaitForIt

Promises that resolve when prompted

Usage

There are three methods "wait", "push" and "error".

Wait

Wait returns a promise that will resolve when a value is pushed to the waitforit instance.

For example:

let a = await waitforit.wait<string>("someid")

Push

Push pushes a result to all waiting promises with the same id specified.

For example:

waitforit.push("someid", "somevalue")

Error

Error pushes an error to all waiting promises with the same id specified.

For example:

waitforit.error("someid", new Error("something happened"))

Readme

Keywords

none

Package Sidebar

Install

npm i @thatsmrtalbot/waitforit

Weekly Downloads

1

Version

1.0.8

License

MIT

Last publish

Collaborators

  • thatsmrtalbot