src/basis/data.js
function(items){
      var delta = this.set(items) || {};
      var deleted = delta.deleted;

      Dataset.setAccumulateState(true);
      if (deleted)
        for (var i = 0, object; object = deleted[i]; i++)
          object.destroy();
      Dataset.setAccumulateState(false);

      return delta.inserted;
    }
function(items){
      var delta = this.set(items) || {};
      var deleted = delta.deleted;

      Dataset.setAccumulateState(true);
      if (deleted)
        for (var i = 0, object; object = deleted[i]; i++)
          object.destroy();
      Dataset.setAccumulateState(false);

      return delta.inserted;
    }
function ( items ) { var delta = this . set ( items ) || { } ; var deleted = delta . deleted ; Dataset . setAccumulateState ( true ) ; if ( deleted ) for ( var i = 0 , object ; object = deleted [ i ] ; i ++ ) object . destroy ( ) ; Dataset . setAccumulateState ( false ) ; return delta . inserted ; }
Set new item set and destroy deleted items.
@param {Array.<basis.data.Object>} items
@return {Array.<basis.data.Object>|undefined} Returns array of inserted items or undefined if nothing inserted.
Set new item set and destroy deleted items .