examples/todos/js/backbonefire.js
function(remoteAttributes, localAttributes) {
          var updateAttributes = {};

          var union = _.union(_.keys(remoteAttributes), _.keys(localAttributes));

          _.each(union, function(key) {
            if (!_.has(localAttributes, key)) {
              updateAttributes[key] = null;
            } else if (localAttributes[key] != remoteAttributes[key]) {
              updateAttributes[key] = localAttributes[key];
            }
          });

          return updateAttributes;
        }
function(remoteAttributes, localAttributes) {
          var updateAttributes = {};

          var union = _.union(_.keys(remoteAttributes), _.keys(localAttributes));

          _.each(union, function(key) {
            if (!_.has(localAttributes, key)) {
              updateAttributes[key] = null;
            } else if (localAttributes[key] != remoteAttributes[key]) {
              updateAttributes[key] = localAttributes[key];
            }
          });

          return updateAttributes;
        }
function ( remoteAttributes , localAttributes ) { var updateAttributes = { } ; var union = _ . union ( _ . keys ( remoteAttributes ) , _ . keys ( localAttributes ) ) ; _ . each ( union , function ( key ) { if ( ! _ . has ( localAttributes , key ) ) { updateAttributes [ key ] = null ; } else if ( localAttributes [ key ] != remoteAttributes [ key ] ) { updateAttributes [ key ] = localAttributes [ key ] ; } } ) ; return updateAttributes ; }
set the attributes to be updated to Firebase set any removed attributes to null so that Firebase removes them
set the attributes to be updated to Firebase set any removed attributes to null so that Firebase removes them