src/chunk.js
/**
 * Run the given function. For visible documents the function will be
 * called in a micro task (Essentially ASAP). If the document is
 * not visible, tasks will yield to the event loop (to give the browser
 * time to do other things) and may even be further delayed until
 * there is time.
 *
 * @param {!Node|!./service/ampdoc-impl.AmpDoc} nodeOrAmpDoc
 * @param {function(?IdleDeadline)} fn
 */
Run the given function. For visible documents the function will be
called in a micro task (Essentially ASAP). If the document is
not visible, tasks will yield to the event loop (to give the browser
time to do other things) and may even be further delayed until
there is time.


Run the given function . For visible documents the function will be called in a micro task ( Essentially ASAP ) . If the document is not visible tasks will yield to the event loop ( to give the browser time to do other things ) and may even be further delayed until there is time .
function startupChunk(nodeOrAmpDoc, fn) {
  if (deactivated) {
    resolved.then(fn);
    return;
  }
  const service = getChunkServiceForDoc_(nodeOrAmpDoc);
  service.runForStartup_(fn);
}
function startupChunk ( nodeOrAmpDoc , fn ) { if ( deactivated ) { resolved . then ( fn ) ; return ; } const service = getChunkServiceForDoc_ ( nodeOrAmpDoc ) ; service . runForStartup_ ( fn ) ; }
Run the given function.
Run the given function .