Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function createDOMInterface(renderer: DOMRenderer): Function {
renderer.styleNodes = reflushStyleNodes()
const baseNode = renderer.styleNodes[RULE_TYPE]
return function changeSubscription(change) {
if (change.type === CLEAR_TYPE) {
for (const node in renderer.styleNodes) {
renderer.styleNodes[node].textContent = ''
}
return
}
const styleNode = getStyleNode(
renderer.styleNodes,
baseNode,
change.type,
change.media
export default function initStyleNodes(renderer: Object): void {
renderer.styleNodes = reflushStyleNodes()
const baseNode = renderer.styleNodes[RULE_TYPE]
for (const style in sheetMap) {
if (renderer[style].length > 0) {
initNode(renderer.styleNodes, baseNode, renderer[style], sheetMap[style])
}
}
for (const media in renderer.mediaRules) {
const mediaCSS = renderer.mediaRules[media]
if (mediaCSS.length > 0) {
initNode(renderer.styleNodes, baseNode, mediaCSS, RULE_TYPE, media)
}
}
}