MCPcopy Create free account
hub / github.com/microsoft/SandDance / loadStyles

Function loadStyles

docs/app/js/sanddance-app.js:27090–27100  ·  view source on GitHub ↗
(styles, loadAsync)

Source from the content-addressed store, hash-verified

27088 return state;
27089}
27090function loadStyles(styles, loadAsync) {
27091 if (loadAsync === void 0) loadAsync = false;
27092 measure(function() {
27093 var styleParts = Array.isArray(styles) ? styles : splitStyles(styles);
27094 var _a = _themeState.runState, mode = _a.mode, buffer = _a.buffer, flushTimer = _a.flushTimer;
27095 if (loadAsync || mode === 1 /* async */ ) {
27096 buffer.push(styleParts);
27097 if (!flushTimer) _themeState.runState.flushTimer = asyncLoadStyles();
27098 } else applyThemableStyles(styleParts);
27099 });
27100}
27101function configureLoadStyles(loadStylesFn) {
27102 _themeState.loadStyles = loadStylesFn;
27103}

Callers

nothing calls this directly

Calls 4

splitStylesFunction · 0.85
asyncLoadStylesFunction · 0.85
applyThemableStylesFunction · 0.85
measureFunction · 0.70

Tested by

no test coverage detected