Closed mateusvahl closed 2 years ago
Most Promise libraries will handle this for you. See how I use Bluebird.promisifyAll
here:
https://github.com/cmwelsh/facebook-friend-list/blob/master/src/lib/facebook-api.js#L6
Yhep, but maybe can be a good idea as default, we don't need remove callbacks.
Actually I made an utility wrapper around, You can check here. https://github.com/transedward/fb_promise
fb@^2.0.0-alpha1
(npm install fb@next
) now supports Promises natively.
When FB.api
is called without a callback a Promise is returned instead. The promise implementation used can be controlled using either any-promise
's registration or by setting the Promise
option.
Since promises will be native in ES6 and currently methods do not return to anything important, we could return a Promise using any polyfill.
Opinions?