@josephg/resolvable
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Resolvable promise wrapper

This is a tiny promise wrapper which gives you promises which have explicit promise.resolve() / promise.reject() methods.

Eg:

const resolvable = require('resolvable')

const myPromise = resolvable()

;(async () => {
  doThingA()
  await myPromise
  doThingB()
})()

setTimeout(() => myPromise.resolve(), 1000)

Readme

Keywords

none

Package Sidebar

Install

npm i @josephg/resolvable

Weekly Downloads

1,479,391

Version

1.0.1

License

ISC

Unpacked Size

3.21 kB

Total Files

7

Last publish

Collaborators

  • josephg