Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 7d48ec3

Browse files
committed
Added update method to list of available
commands
1 parent a92cb06 commit 7d48ec3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

firebase.android.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,18 @@ firebase.setValue = function (path, val) {
251251
});
252252
};
253253

254+
firebase.update = function (path, val) {
255+
return new Promise(function (resolve, reject) {
256+
try {
257+
instance.child(path).updateChildren(firebase.toHashMap(val));
258+
resolve();
259+
} catch (ex) {
260+
console.log("Error in firebase.update: " + ex);
261+
reject(ex);
262+
}
263+
});
264+
};
265+
254266
firebase.query = function (updateCallback, path, options) {
255267
return new Promise(function (resolve, reject) {
256268
try {

firebase.ios.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ firebase.setValue = function (path, val) {
206206
});
207207
};
208208

209+
firebase.update = function (path, val) {
210+
return new Promise(function (resolve, reject) {
211+
try {
212+
instance.childByAppendingPath(path).updateChildValues(val);
213+
resolve();
214+
} catch (ex) {
215+
console.log("Error in firebase.update: " + ex);
216+
reject(ex);
217+
}
218+
});
219+
};
220+
209221
firebase.query = function (updateCallback, path, options) {
210222
return new Promise(function (resolve, reject) {
211223
try {

0 commit comments

Comments
 (0)