build/sob.max.amd.js
function animationLoop() {
  var
    // grab current time
    t = time(),
    // calculate how many millisends we have
    fps = 1000 / next.minFPS,
    // used to flag overtime in case we exceed milliseconds
    overTime = false,
    // take current frame queue length
    length = getLength(qframe, qframex)
  ;
  // if there is actually something to do
  if (length) {
    // reschedule upfront next animation frame
    // this prevents the need for a try/catch within the while loop
    requestAnimationFrame(animationLoop);
    // reassign qframex cleaning current animation frame queue
    qframex = qframe.splice(0, length);
    while (qframex.length) {
      // if some of them fails, it's OK
      // next round will re-prioritize the animation frame queue
      exec(qframex.shift());
      // if we exceeded the frame time, get out this loop
      overTime = (time() - t) >= fps;
      if ((next.isOverloaded = overTime)) break;
    }
    // if overtime and debug is true, warn about it
    if (overTime && next.debug) console.warn('overloaded frame');
  } else {
    // all frame callbacks have been executed
    // we can actually stop asking for animation frames
    frameRunning = false;
    // and flag it as non busy/overloaded anymore
    next.isOverloaded = frameRunning;
  }
}
function animationLoop() {
  var
    // grab current time
    t = time(),
    // calculate how many millisends we have
    fps = 1000 / next.minFPS,
    // used to flag overtime in case we exceed milliseconds
    overTime = false,
    // take current frame queue length
    length = getLength(qframe, qframex)
  ;
  // if there is actually something to do
  if (length) {
    // reschedule upfront next animation frame
    // this prevents the need for a try/catch within the while loop
    requestAnimationFrame(animationLoop);
    // reassign qframex cleaning current animation frame queue
    qframex = qframe.splice(0, length);
    while (qframex.length) {
      // if some of them fails, it's OK
      // next round will re-prioritize the animation frame queue
      exec(qframex.shift());
      // if we exceeded the frame time, get out this loop
      overTime = (time() - t) >= fps;
      if ((next.isOverloaded = overTime)) break;
    }
    // if overtime and debug is true, warn about it
    if (overTime && next.debug) console.warn('overloaded frame');
  } else {
    // all frame callbacks have been executed
    // we can actually stop asking for animation frames
    frameRunning = false;
    // and flag it as non busy/overloaded anymore
    next.isOverloaded = frameRunning;
  }
}
function animationLoop ( ) { var // grab current time t = time ( ) , // calculate how many millisends we have fps = 1000 / next . minFPS , // used to flag overtime in case we exceed milliseconds overTime = false , // take current frame queue length length = getLength ( qframe , qframex ) ; // if there is actually something to do if ( length ) { // reschedule upfront next animation frame // this prevents the need for a try/catch within the while loop requestAnimationFrame ( animationLoop ) ; // reassign qframex cleaning current animation frame queue qframex = qframe . splice ( 0 , length ) ; while ( qframex . length ) { // if some of them fails, it's OK // next round will re-prioritize the animation frame queue exec ( qframex . shift ( ) ) ; // if we exceeded the frame time, get out this loop overTime = ( time ( ) - t ) >= fps ; if ( ( next . isOverloaded = overTime ) ) break ; } // if overtime and debug is true, warn about it if ( overTime && next . debug ) console . warn ( 'overloaded frame' ) ; } else { // all frame callbacks have been executed // we can actually stop asking for animation frames frameRunning = false ; // and flag it as non busy/overloaded anymore next . isOverloaded = frameRunning ; } }
responsible for centralized requestAnimationFrame operations
responsible for centralized requestAnimationFrame operations