Miss any of our Open RFC calls?Watch the recordings here! »

promisify-f

1.0.2 • Public • Published

promisify-f

Turns a function that returns a future into a function that returns a promise.

install

npm install promisify-f

example

const promisify = require('promisify-f')
 
const futureIncrement = (ms, n) => new Future((reject, resolve) => {
  setTimeout(() => {
    resolve(+ 1)
  }, ms)
})
 
const incrementAsync = promisify(futureIncrement)
incrementAsync(500, 7).then(console.log) //=> 8

Install

npm i promisify-f

DownloadsWeekly Downloads

4

Version

1.0.2

License

CC0-1.0

Last publish

Collaborators

  • avatar