-
Notifications
You must be signed in to change notification settings - Fork 510
Description
I'm dealing with an old codebase, and I already replaced many methods from lodash, underscore and bluebird with this library and it works amazingly well! Extra points for having great type inference and typescript support 🙌
But I still have a request that would be great if this library could support. We deal with many old libraries that only use callback methods. Currently we are using Bluebird promisify or even node:util with promisify.
http://bluebirdjs.com/docs/api/promise.promisify.html
https://nodejs.org/api/util.html#utilpromisifyoriginal
Bluebird doesn't play very well with TypeScript, and it is very outdated. Node is only available on the server, not in the client browser, so for frontend usage, it is not that direct. It would be wonderful if this library had this method.
Point of attention: sometimes we need to bind the context of the function to the promisify. I wonder if this could be done automatically somehow? Example from bluebird docs:
var redisGet = Promise.promisify(redisClient.get, {context: redisClient});
redisGet('foo').then(function() {
//...
});Thanks!