1.2.3 • Published 6 years ago

webcom-as-promised v1.2.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Webcom as Promised

Promise wrapper for Webcom library.

Build Status Maintainability npm Webcom Version Webcom Version

The promised wrapper that will protect you from falling into the callback hell.

Installation

npm i webcom-as-promised

Example

const Webcom = require('webcom-as-promised');

const webcomRef = new Webcom('YOUR NAMESPACE URL');

webcomRef
  .authWithPassword({
    "email":"email@example.com",
    "password": "$0ME_P@$$W0RD"
  })
  .then((auth) => {
    console.log(`Whola! authed sucessfully!`);
    return webcomRef.child('sub_child').valueAsync();
  })
  .then((v) => v.val())
  .then((val) => console.log(`Value sub_child is ${val}`))
  .catch(console.log);

Promisified APIs

Callback APIPromise API
valuevalueAsync
updateupdateAsync
setsetAsync
removeremoveAsync
pushpushAsync
resumeresumeAsync
logoutlogoutAsync

New APIs

  1. confirmEmail
  2. resetPassword
  3. getPathFromRoot
  4. navigateFromRoot

Thanks

All thanks to Mohamad Gamal for his contribution in developing this wrapper.

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago