torso-bundle.js
function() {
      var oldViews = this.getItemViews();
      var newViews = this.__createItemViews();
      var staleViews = this.__getStaleItemViews();
      var sizeOfOldViews = _.size(oldViews);
      var sizeOfNewViews = _.size(newViews);
      var sizeOfStaleViews = _.size(staleViews);
      var sizeOfFinalViews = sizeOfOldViews - sizeOfStaleViews + sizeOfNewViews;
      var changes = sizeOfNewViews + sizeOfStaleViews;
      var percentChange = changes / Math.max(sizeOfFinalViews, 1);
      var fromEmptyToNotEmpty = !sizeOfOldViews && sizeOfNewViews;
      var fromNotEmptyToEmpty = sizeOfOldViews && sizeOfOldViews === sizeOfStaleViews && !sizeOfNewViews;
      var threshold = this.updateThreshold || 0.5;
      var signficantChanges = percentChange >= threshold;
      if (changes <= 0) {
        return this.reorder();
      }
      // A switch from empty to not empty or vise versa, needs a new render
      var renderNeeded = fromEmptyToNotEmpty || fromNotEmptyToEmpty || signficantChanges;
      if (renderNeeded) {
        this.__removeStaleItemViews(staleViews);
        this.__delayedRender();
      } else {
        this.__updateByAddingRemoving(oldViews, newViews, staleViews);
      }
    }
function() {
      var oldViews = this.getItemViews();
      var newViews = this.__createItemViews();
      var staleViews = this.__getStaleItemViews();
      var sizeOfOldViews = _.size(oldViews);
      var sizeOfNewViews = _.size(newViews);
      var sizeOfStaleViews = _.size(staleViews);
      var sizeOfFinalViews = sizeOfOldViews - sizeOfStaleViews + sizeOfNewViews;
      var changes = sizeOfNewViews + sizeOfStaleViews;
      var percentChange = changes / Math.max(sizeOfFinalViews, 1);
      var fromEmptyToNotEmpty = !sizeOfOldViews && sizeOfNewViews;
      var fromNotEmptyToEmpty = sizeOfOldViews && sizeOfOldViews === sizeOfStaleViews && !sizeOfNewViews;
      var threshold = this.updateThreshold || 0.5;
      var signficantChanges = percentChange >= threshold;
      if (changes <= 0) {
        return this.reorder();
      }
      // A switch from empty to not empty or vise versa, needs a new render
      var renderNeeded = fromEmptyToNotEmpty || fromNotEmptyToEmpty || signficantChanges;
      if (renderNeeded) {
        this.__removeStaleItemViews(staleViews);
        this.__delayedRender();
      } else {
        this.__updateByAddingRemoving(oldViews, newViews, staleViews);
      }
    }
function ( ) { var oldViews = this . getItemViews ( ) ; var newViews = this . __createItemViews ( ) ; var staleViews = this . __getStaleItemViews ( ) ; var sizeOfOldViews = _ . size ( oldViews ) ; var sizeOfNewViews = _ . size ( newViews ) ; var sizeOfStaleViews = _ . size ( staleViews ) ; var sizeOfFinalViews = sizeOfOldViews - sizeOfStaleViews + sizeOfNewViews ; var changes = sizeOfNewViews + sizeOfStaleViews ; var percentChange = changes / Math . max ( sizeOfFinalViews , 1 ) ; var fromEmptyToNotEmpty = ! sizeOfOldViews && sizeOfNewViews ; var fromNotEmptyToEmpty = sizeOfOldViews && sizeOfOldViews === sizeOfStaleViews && ! sizeOfNewViews ; var threshold = this . updateThreshold || 0.5 ; var signficantChanges = percentChange >= threshold ; if ( changes <= 0 ) { return this . reorder ( ) ; } // A switch from empty to not empty or vise versa, needs a new render var renderNeeded = fromEmptyToNotEmpty || fromNotEmptyToEmpty || signficantChanges ; if ( renderNeeded ) { this . __removeStaleItemViews ( staleViews ) ; this . __delayedRender ( ) ; } else { this . __updateByAddingRemoving ( oldViews , newViews , staleViews ) ; } }
Builds any new views, removes stale ones, and re-renders
@method update
Builds any new views removes stale ones and re - renders