src/basis/data.js
function(data){
      if (this.delegate)
        return this.root.update(data);

      if (data)
      {
        var delta = {};
        var changed = false;

        for (var prop in data)
          if (this.data[prop] !== data[prop])
          {
            changed = true;
            delta[prop] = this.data[prop];
            this.data[prop] = data[prop];
          }

        if (changed)
        {
          this.emit_update(delta);
          return delta;
        }
      }

      return false;
    }
function(data){
      if (this.delegate)
        return this.root.update(data);

      if (data)
      {
        var delta = {};
        var changed = false;

        for (var prop in data)
          if (this.data[prop] !== data[prop])
          {
            changed = true;
            delta[prop] = this.data[prop];
            this.data[prop] = data[prop];
          }

        if (changed)
        {
          this.emit_update(delta);
          return delta;
        }
      }

      return false;
    }
function ( data ) { if ( this . delegate ) return this . root . update ( data ) ; if ( data ) { var delta = { } ; var changed = false ; for ( var prop in data ) if ( this . data [ prop ] !== data [ prop ] ) { changed = true ; delta [ prop ] = this . data [ prop ] ; this . data [ prop ] = data [ prop ] ; } if ( changed ) { this . emit_update ( delta ) ; return delta ; } } return false ; }
Handle changing object data. Fires update event only if something was changed.
@param {Object} data New values for object data holder (this.data).
@return {Object|boolean} Delta if object data (this.data) was updated or false otherwise.
Handle changing object data . Fires update event only if something was changed .