fb-promise-wrapper

1.0.0 • Public • Published

fb-promise-wrapper

Build Status Coverage Status

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  = require('fb-promise-wrapper')

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:

.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.getFB().then((FB) => {
    //Your code …
})

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.

/fb-promise-wrapper/

    Package Sidebar

    Install

    npm i fb-promise-wrapper

    Weekly Downloads

    2

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • mscharl