src/basis/data/dataset/Merge.js
function(sources){
    var exists = this.sourceValues_.map(function(sourceInfo){
      return sourceInfo.source;
    });
    var inserted = [];
    var deleted = [];
    var delta;

    if (!sources)
      sources = [];

    this.sourceDelta_ = {
      inserted: inserted,
      deleted: deleted
    };

    for (var i = 0; i < sources.length; i++)
    {
      var source = sources[i];
      if (!arrayRemove(exists, source))
        this.addSource(source);
    }

    exists.forEach(this.removeSource, this);

    this.sourceDelta_ = null;
    if (delta = getDelta(inserted, deleted))
      this.emit_sourcesChanged(delta);

    return delta;
  }
function(sources){
    var exists = this.sourceValues_.map(function(sourceInfo){
      return sourceInfo.source;
    });
    var inserted = [];
    var deleted = [];
    var delta;

    if (!sources)
      sources = [];

    this.sourceDelta_ = {
      inserted: inserted,
      deleted: deleted
    };

    for (var i = 0; i < sources.length; i++)
    {
      var source = sources[i];
      if (!arrayRemove(exists, source))
        this.addSource(source);
    }

    exists.forEach(this.removeSource, this);

    this.sourceDelta_ = null;
    if (delta = getDelta(inserted, deleted))
      this.emit_sourcesChanged(delta);

    return delta;
  }
function ( sources ) { var exists = this . sourceValues_ . map ( function ( sourceInfo ) { return sourceInfo . source ; } ) ; var inserted = [ ] ; var deleted = [ ] ; var delta ; if ( ! sources ) sources = [ ] ; this . sourceDelta_ = { inserted : inserted , deleted : deleted } ; for ( var i = 0 ; i < sources . length ; i ++ ) { var source = sources [ i ] ; if ( ! arrayRemove ( exists , source ) ) this . addSource ( source ) ; } exists . forEach ( this . removeSource , this ) ; this . sourceDelta_ = null ; if ( delta = getDelta ( inserted , deleted ) ) this . emit_sourcesChanged ( delta ) ; return delta ; }
Synchonize sources list according new list.
@param {Array.<basis.data.ReadOnlyDataset>} sources
Synchonize sources list according new list .