MCPcopy Create free account
hub / github.com/caseywebdev/react-list / preinitScript

Function preinitScript

docs/index.js:17264–17289  ·  view source on GitHub ↗
(src, options)

Source from the content-addressed store, hash-verified

17262 }
17263}
17264function preinitScript(src, options) {
17265 previousDispatcher.X(src, options);
17266 var ownerDocument = globalDocument;
17267 if (ownerDocument && src) {
17268 var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts,
17269 key = getScriptKey(src),
17270 resource = scripts.get(key);
17271 resource ||
17272 ((resource = ownerDocument.querySelector(getScriptSelectorFromKey(key))),
17273 resource ||
17274 ((src = assign({ src: src, async: !0 }, options)),
17275 (options = preloadPropsMap.get(key)) &&
17276 adoptPreloadPropsForScript(src, options),
17277 (resource = ownerDocument.createElement("script")),
17278 markNodeAsHoistable(resource),
17279 setInitialProperties(resource, "link", src),
17280 ownerDocument.head.appendChild(resource)),
17281 (resource = {
17282 type: "script",
17283 instance: resource,
17284 count: 1,
17285 state: null
17286 }),
17287 scripts.set(key, resource));
17288 }
17289}
17290function preinitModuleScript(src, options) {
17291 previousDispatcher.M(src, options);
17292 var ownerDocument = globalDocument;

Callers

nothing calls this directly

Calls 6

getResourcesFromRootFunction · 0.85
getScriptKeyFunction · 0.85
getScriptSelectorFromKeyFunction · 0.85
markNodeAsHoistableFunction · 0.85
setInitialPropertiesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…