fb-promise-wrapper
A Facebook Javascript SDK wrapper for using FB with native JS-Promises
Installation
Add to your package.json
npm install --save fb-promise-wrapper
Usage
const FBPromise =
Each wrapper function lacks of a callback parameter. Instead a promise is returned and resolves or rejects with the response data from Facebook.
The following wrapper functions are provided:
.logout()
- FB Docs.login(opts)
- FB Docs.getLoginStatus()
- FB Docs.ui(params)
- FB Docs.api(path, method, params)
- FB Docs
.getFB()
Like the wrapper functions this function returnes a promise. But it 'only' resolves with the FB-Object itself.
So you don't have to wait and check for Facebook to be loaded. You can just do:
FBPromise
If you use on of the wrapper functions this is already done for you!
Support
Please open an issue for support.
Contributing
Create a branch, add commits, and open a pull request.