MCPcopy Index your code
hub / github.com/caseywebdev/react-list / preloadStylesheet

Function preloadStylesheet

docs/index.js:17437–17451  ·  view source on GitHub ↗
(ownerDocument, key, preloadProps, state)

Source from the content-addressed store, hash-verified

17435 });
17436}
17437function preloadStylesheet(ownerDocument, key, preloadProps, state) {
17438 ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]")
17439 ? (state.loading = 1)
17440 : ((key = ownerDocument.createElement("link")),
17441 (state.preload = key),
17442 key.addEventListener("load", function () {
17443 return (state.loading |= 1);
17444 }),
17445 key.addEventListener("error", function () {
17446 return (state.loading |= 2);
17447 }),
17448 setInitialProperties(key, "link", preloadProps),
17449 markNodeAsHoistable(key),
17450 ownerDocument.head.appendChild(key));
17451}
17452function getScriptKey(src) {
17453 return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
17454}

Callers 1

getResourceFunction · 0.85

Calls 2

setInitialPropertiesFunction · 0.85
markNodeAsHoistableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…