MCPcopy
hub / github.com/ampproject/amphtml / startupChunk

Function startupChunk

src/chunk.js:53–65  ·  view source on GitHub ↗
(doc, fn, opt_makesBodyVisible)

Source from the content-addressed store, hash-verified

51 * task scheduling strategy.
52 */
53export function startupChunk(doc, fn, opt_makesBodyVisible) {
54 if (deactivated) {
55 resolved.then(fn);
56 return;
57 }
58 const service = chunkServiceForDoc(doc.documentElement || doc);
59 service.runForStartup(fn);
60 if (opt_makesBodyVisible) {
61 service.runForStartup(() => {
62 service.bodyIsVisible_ = true;
63 });
64 }
65}
66
67/**
68 * Run the given function sometime in the future without blocking UI.

Callers 9

basicTestsFunction · 0.90
test-chunk.jsFile · 0.90
preconnectMethod · 0.90
upgradeOrSchedule_Method · 0.90
startRegisterOrChunkFunction · 0.90
bootstrapFunction · 0.90
amp.jsFile · 0.90
constructorMethod · 0.90
amp-inabox.jsFile · 0.90

Calls 3

chunkServiceForDocFunction · 0.85
runForStartupMethod · 0.80
thenMethod · 0.45

Tested by

no test coverage detected