This repository has been archived by the owner on Jul 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Use ES6 Promise in place of callbacks #144
Comments
if people want to use Promise, node v8's promisfy or bluebird's promisfy function is a viable option. 90% of the callbacks plugAPI provides is in the correct form of callback(err, data) => {}; (There are a few that only callback(data) ) I see no benefit of having to rewrite the entire lib to use promises and making people change their existing code to have to use promises. |
Do either v8's or bluebirds promisify work on PAPI yet? last time I checked
they did not
|
In my opinion, using a standard feature of the platform is a benefit in and of itself. |
As a kind of compromise, maybe methods that take a callback could return a promise if called without a callback argument? |
As an interim solution, I wrote this function:
Or, if you want to be slightly more evil:
;) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think this would be a beneficial change long term - 6.0?
The text was updated successfully, but these errors were encountered: