aantron / promise

Light and type-safe binding to JS promises
MIT License
340 stars 24 forks source link

Add "promisify" function #47

Closed aantron closed 5 years ago

aantron commented 5 years ago
let p = Repromise.promisify(resolve => resolve());

This is basically the new Promise constructor. It's more convenient when you already have a function that takes a callback, that you can call inside promisify. The existing Repromise.make is more convenient when you need to pass resolve to somewhere later, or store it.

Not sure about the name yet :)