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

Commit

Permalink
#547 Add a 'getValue' function to mimic the Web API's 'once'
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Nov 21, 2017
1 parent dd9382d commit 7a9cc9f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
[Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android)


## 5.0.0 (work in progress)

### New
- [#547](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/547) Add a 'getValue' function to mimic the Web API's 'once'


## 4.2.1 (2017, October 24)

### Fixes
Expand Down
9 changes: 9 additions & 0 deletions docs/DATABASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ The plugin will take care of serializing JSON data to native data structures.
);
```

### getValue
To just get a value at a certain path 'once', use this convenience method:

```js
firebase.getValue('/companies').then(function(result) {
console.log(JSON.stringify(result));
});
```

#### Adding an update timestamp
If you want to have Firebase a timestamp to your data (instead of clients which likely are not synchronized),
you can use the placeholder value `firebase.ServerValue.TIMESTAMP` (or `firebase["ServerValue"].TIMESTAMP` if your IDE complains about the former), so for instance:
Expand Down

0 comments on commit 7a9cc9f

Please sign in to comment.