lib/object.js
function() {
      var self = this;

      var previousAttributes = _.clone(this.attributes);

      this.attributes = _.clone(this._serverData);
      Parse._arrayEach(this._opSetQueue, function(opSet) {
        self._applyOpSet(opSet, self.attributes);
        Parse._objectEach(opSet, function(op, key) {
          self._resetCacheForKey(key);
        });
      });

      // Trigger change events for anything that changed because of the fetch.
      Parse._objectEach(previousAttributes, function(oldValue, key) {
        if (self.attributes[key] !== oldValue) {
          self.trigger('change:' + key, self, self.attributes[key], {});
        }
      });
      Parse._objectEach(this.attributes, function(newValue, key) {
        if (!_.has(previousAttributes, key)) {
          self.trigger('change:' + key, self, newValue, {});
        }
      });
    }
function() {
      var self = this;

      var previousAttributes = _.clone(this.attributes);

      this.attributes = _.clone(this._serverData);
      Parse._arrayEach(this._opSetQueue, function(opSet) {
        self._applyOpSet(opSet, self.attributes);
        Parse._objectEach(opSet, function(op, key) {
          self._resetCacheForKey(key);
        });
      });

      // Trigger change events for anything that changed because of the fetch.
      Parse._objectEach(previousAttributes, function(oldValue, key) {
        if (self.attributes[key] !== oldValue) {
          self.trigger('change:' + key, self, self.attributes[key], {});
        }
      });
      Parse._objectEach(this.attributes, function(newValue, key) {
        if (!_.has(previousAttributes, key)) {
          self.trigger('change:' + key, self, newValue, {});
        }
      });
    }
function ( ) { var self = this ; var previousAttributes = _ . clone ( this . attributes ) ; this . attributes = _ . clone ( this . _serverData ) ; Parse . _arrayEach ( this . _opSetQueue , function ( opSet ) { self . _applyOpSet ( opSet , self . attributes ) ; Parse . _objectEach ( opSet , function ( op , key ) { self . _resetCacheForKey ( key ) ; } ) ; } ) ; // Trigger change events for anything that changed because of the fetch. Parse . _objectEach ( previousAttributes , function ( oldValue , key ) { if ( self . attributes [ key ] !== oldValue ) { self . trigger ( 'change:' + key , self , self . attributes [ key ] , { } ) ; } } ) ; Parse . _objectEach ( this . attributes , function ( newValue , key ) { if ( ! _ . has ( previousAttributes , key ) ) { self . trigger ( 'change:' + key , self , newValue , { } ) ; } } ) ; }
Populates attributes by starting with the last known data from the
server, and applying all of the local changes that have been made since
then.
Populates attributes by starting with the last known data from the server and applying all of the local changes that have been made since then .