How to use the incremental-dom.applyAttr function in incremental-dom

To help you get started, we’ve selected a few incremental-dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spectjs / spect / src / html.js View on Github external
attributes.is = (target, name, value) => {
  if (target.setAttribute) applyAttr(target, name, value)
  return applyProp(target, name, value)
}
attributes[symbols.default] = applyProp
github spectjs / spect / src / html-idom.js View on Github external
attributes.is = (target, name, value) => {
  if (target.setAttribute) applyAttr(target, name, value)
  return applyProp(target, name, value)
}
attributes[symbols.default] = applyProp
github tailhook / khufu / khufu-runtime / src / index.js View on Github external
function applyAttribute(el, name, value) {
    let type = typeof value
    let prop = PROPERTIES[name]
    if(prop) {
        applyProp(el, prop, value)
    } else if (type === 'object' || type === 'function' || type == 'boolean') {
        applyProp(el, name, value)
    } else {
        applyAttr(el, name, value)
    }
}