@thatsmrtalbot/waitforit
v1.0.8
Published
[![Build Status](https://travis-ci.org/ThatsMrTalbot/waitforit.svg?branch=master)](https://travis-ci.org/ThatsMrTalbot/waitforit)
Downloads
8
Readme
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"))