Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@josephg/resolvable

josephg3.6mISC1.0.1TypeScript support: included

Promise with .resolve() and .reject() methods

readme

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)