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

Commit

Permalink
Added TypeScript definition for the update feature
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Apr 9, 2016
1 parent 247dd31 commit 8fac5ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions firebase.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ firebase.setValue = function (path, val) {
};

firebase.update = function (path, val) {
return new Promise(function (resolve, reject) {
try {
instance.child(path).updateChildren(firebase.toHashMap(val));
resolve();
} catch (ex) {
console.log("Error in firebase.update: " + ex);
reject(ex);
}
});
return new Promise(function (resolve, reject) {
try {
instance.child(path).updateChildren(firebase.toHashMap(val));
resolve();
} catch (ex) {
console.log("Error in firebase.update: " + ex);
reject(ex);
}
});
};

firebase.query = function (updateCallback, path, options) {
Expand Down
1 change: 1 addition & 0 deletions firebase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ declare module "nativescript-plugin-firebase" {
export function resetPassword(options: ResetPasswordOptions): Promise<any>;
export function push(path: string, value: any): Promise<PushResult>;
export function setValue(path: string, value: any): Promise<any>;
export function update(path: string, value: any): Promise<any>;
export function remove(path: string): Promise<any>;
export function query(onValueEvent: (data: FBData) => void, path: string, options: QueryOptions): Promise<any>;
export function addChildEventListener(onChildEvent: (data: FBData) => void, path: string): Promise<any>;
Expand Down

0 comments on commit 8fac5ea

Please sign in to comment.