webcom-as-promised
v1.2.3
Published
Promise wrapper for webcom library
Downloads
14
Maintainers
Readme
Webcom as Promised
Promise wrapper for Webcom library.
The promised wrapper that will protect you from falling into the callback hell.
Installation
npm i webcom-as-promisedExample
const Webcom = require('webcom-as-promised');
const webcomRef = new Webcom('YOUR NAMESPACE URL');
webcomRef
.authWithPassword({
"email":"[email protected]",
"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 API | Promise API | |:--------:|:-------:| |value|valueAsync| |update|updateAsync| |set|setAsync| |remove|removeAsync| |push|pushAsync| |resume|resumeAsync| |logout|logoutAsync|
New APIs
confirmEmailresetPasswordgetPathFromRootnavigateFromRoot
Thanks
All thanks to Mohamad Gamal for his contribution in developing this wrapper.
