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

Commit 8fac5ea

Browse files
Added TypeScript definition for the update feature
1 parent 247dd31 commit 8fac5ea

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

firebase.android.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ firebase.setValue = function (path, val) {
278278
};
279279

280280
firebase.update = function (path, val) {
281-
return new Promise(function (resolve, reject) {
282-
try {
283-
instance.child(path).updateChildren(firebase.toHashMap(val));
284-
resolve();
285-
} catch (ex) {
286-
console.log("Error in firebase.update: " + ex);
287-
reject(ex);
288-
}
289-
});
281+
return new Promise(function (resolve, reject) {
282+
try {
283+
instance.child(path).updateChildren(firebase.toHashMap(val));
284+
resolve();
285+
} catch (ex) {
286+
console.log("Error in firebase.update: " + ex);
287+
reject(ex);
288+
}
289+
});
290290
};
291291

292292
firebase.query = function (updateCallback, path, options) {

firebase.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ declare module "nativescript-plugin-firebase" {
116116
export function resetPassword(options: ResetPasswordOptions): Promise<any>;
117117
export function push(path: string, value: any): Promise<PushResult>;
118118
export function setValue(path: string, value: any): Promise<any>;
119+
export function update(path: string, value: any): Promise<any>;
119120
export function remove(path: string): Promise<any>;
120121
export function query(onValueEvent: (data: FBData) => void, path: string, options: QueryOptions): Promise<any>;
121122
export function addChildEventListener(onChildEvent: (data: FBData) => void, path: string): Promise<any>;

0 commit comments

Comments
 (0)