src/basis/data/dataset/Merge.js
function(scope){
    var memberMap = this.members_;
    var rule = this.rule;
    var sourceCount = this.sources.length;
    var inserted = [];
    var deleted = [];
    var memberCounter;
    var isMember;
    var delta;

    if (!scope)
      scope = memberMap;

    for (var objectId in scope)
    {
      memberCounter = memberMap[objectId];
      isMember = sourceCount && memberCounter.count && rule(memberCounter.count, sourceCount);

      if (isMember != memberCounter.isMember)
      {
        if (isMember)
        {
          // not in items -> insert
          memberCounter.isMember = true;
          inserted.push(memberCounter.object);
        }
        else
        {
          // already in items -> delete
          memberCounter.isMember = false;
          deleted.push(memberCounter.object);
        }
      }

      if (memberCounter.count == 0)
        delete memberMap[objectId];
    }

    // fire event if delta found
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
function(scope){
    var memberMap = this.members_;
    var rule = this.rule;
    var sourceCount = this.sources.length;
    var inserted = [];
    var deleted = [];
    var memberCounter;
    var isMember;
    var delta;

    if (!scope)
      scope = memberMap;

    for (var objectId in scope)
    {
      memberCounter = memberMap[objectId];
      isMember = sourceCount && memberCounter.count && rule(memberCounter.count, sourceCount);

      if (isMember != memberCounter.isMember)
      {
        if (isMember)
        {
          // not in items -> insert
          memberCounter.isMember = true;
          inserted.push(memberCounter.object);
        }
        else
        {
          // already in items -> delete
          memberCounter.isMember = false;
          deleted.push(memberCounter.object);
        }
      }

      if (memberCounter.count == 0)
        delete memberMap[objectId];
    }

    // fire event if delta found
    if (delta = getDelta(inserted, deleted))
      this.emit_itemsChanged(delta);

    return delta;
  }
function ( scope ) { var memberMap = this . members_ ; var rule = this . rule ; var sourceCount = this . sources . length ; var inserted = [ ] ; var deleted = [ ] ; var memberCounter ; var isMember ; var delta ; if ( ! scope ) scope = memberMap ; for ( var objectId in scope ) { memberCounter = memberMap [ objectId ] ; isMember = sourceCount && memberCounter . count && rule ( memberCounter . count , sourceCount ) ; if ( isMember != memberCounter . isMember ) { if ( isMember ) { // not in items -> insert memberCounter . isMember = true ; inserted . push ( memberCounter . object ) ; } else { // already in items -> delete memberCounter . isMember = false ; deleted . push ( memberCounter . object ) ; } } if ( memberCounter . count == 0 ) delete memberMap [ objectId ] ; } // fire event if delta found if ( delta = getDelta ( inserted , deleted ) ) this . emit_itemsChanged ( delta ) ; return delta ; }
Check all members are they match to rule or not.
@param {Object=} scope Key map that will be checked. If not passed than all members
will be checked.
@return {Object} Delta of member changes.
Check all members are they match to rule or not .