Skip to content

Commit

Permalink
Merge pull request #199 from firebase/API-change-save
Browse files Browse the repository at this point in the history
save -> saveValue
  • Loading branch information
cdata authored Apr 14, 2017
2 parents f168ba2 + e9dbc82 commit b8d0eca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polymerfire",
"version": "0.10.4",
"version": "0.11.0",
"authors": [
"Firebase"
],
Expand Down
10 changes: 5 additions & 5 deletions firebase-document.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
* written to the new path.
* @override
*/
save: function(parentPath, key) {
saveValue: function(parentPath, key) {
return new Promise(function(resolve, reject) {
var path;

Expand Down Expand Up @@ -192,11 +192,11 @@
this.async(function() {
this.syncToMemory(function() {
this._log('Updating data from Firebase value:', value);
// set the value if:

// set the value if:
// it is the first time we run this (or the path has changed and we are back with zeroValue)
// or if this.data does not exist
// or value is primitive
// or if this.data does not exist
// or value is primitive
// or if firebase value obj contain less keys than this.data (https://github.com/Polymer/polymer/issues/2565)
if (this.__needSetData || !this.data || typeof value !== 'object' || ( Object.keys(value).length < Object.keys(this.data).length)) {
this.__needSetData = false;
Expand Down

0 comments on commit b8d0eca

Please sign in to comment.