firebase-unchained
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -76,2 +76,13 @@ 'use strict'; | ||
function psetWithPriority(db) { | ||
return function (path, value, priority) { | ||
var ref = path.setWithPriority ? path : db.child(path); | ||
return new Promise(function (resolve, reject) { | ||
ref.setWithPriority(value, priority, function (err) { | ||
return err ? reject(err) : resolve(); | ||
}); | ||
}); | ||
}; | ||
} | ||
function pupdate(db) { | ||
@@ -99,3 +110,3 @@ return function (path, value) { | ||
function promisifyFirebase(db) { | ||
[pauthWithCustomToken, pget, pval, ppush, pset, pupdate, premove].forEach(function (fn) { | ||
[pauthWithCustomToken, pget, pval, ppush, pset, psetWithPriority, pupdate, premove].forEach(function (fn) { | ||
return db[fn.name] = fn(db); | ||
@@ -102,0 +113,0 @@ }); |
{ | ||
"name": "firebase-unchained", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Promise version of Firebase API without chaining", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3766
103