src/chunk.js
/**
 * Run the given function sometime in the future without blocking UI.
 *
 * Higher priority tasks are executed before lower priority tasks.
 * Tasks with the same priority are executed in FIFO order.
 *
 * Uses `requestIdleCallback` if available and passes the `IdleDeadline`
 * object to the function, which can be used to perform a variable amount
 * of work depending on the remaining amount of idle time.
 *
 * @param {!Node|!./service/ampdoc-impl.AmpDoc} nodeOrAmpDoc
 * @param {function(?IdleDeadline)} fn
 * @param {ChunkPriority} priority
 */
Run the given function sometime in the future without blocking UI.
Higher priority tasks are executed before lower priority tasks.
Tasks with the same priority are executed in FIFO order.

Uses `requestIdleCallback` if available and passes the `IdleDeadline`
object to the function, which can be used to perform a variable amount
of work depending on the remaining amount of idle time.


Run the given function sometime in the future without blocking UI . Higher priority tasks are executed before lower priority tasks . Tasks with the same priority are executed in FIFO order . Uses ` requestIdleCallback ` if available and passes the ` IdleDeadline ` object to the function which can be used to perform a variable amount of work depending on the remaining amount of idle time .
function chunk(nodeOrAmpDoc, fn, priority) {
  if (deactivated) {
    resolved.then(fn);
    return;
  }
  const service = getChunkServiceForDoc_(nodeOrAmpDoc);
  service.run(fn, priority);
}
function chunk ( nodeOrAmpDoc , fn , priority ) { if ( deactivated ) { resolved . then ( fn ) ; return ; } const service = getChunkServiceForDoc_ ( nodeOrAmpDoc ) ; service . run ( fn , priority ) ; }
Run the given function sometime in the future without blocking UI.
Run the given function sometime in the future without blocking UI .