firebase-realtime-databasepolymer-1.0firebase-polymerpolymerfire

Polymerfire - What is the correct way to update firebase values


what is the correct way to update a firebase value? is it to use firebase-document? I understand that in polymerfire, has been deprecated. However, in https://github.com/PolymerLabs/todo-list, I could simply update the collection like so:

<firebase-collection location="{{userLocation}}" data="{{fbTodos}}" 
                     on-firebase-value="_firebaseLoaded">
</firebase-collection>
_firebaseLoaded: function() {
    this._firebaseConnected = true;
    this.todos = this.fbTodos;
    this.backupTodos = this.fbTodos;
    this.linkPaths('fbTodos', 'todos');
    this.linkPaths('backupTodos', 'todos');
    },

......

deleteTodo: function(e) {
 this.arrayDelete('todos', e.detail.todo);
 },

What is the proper way to update firebase db? Btw, what does this.linkPaths do? Without linkPaths, the firebase db is not updated.


Solution

  • Based on the reply on this issue https://github.com/firebase/polymerfire/issues/15, it seems is the way to go.