// @ts-nocheck
export const attributeSink = (node, attributeName) => (value) => node.setAttribute(attributeName, value);
export const attributesSink = (node) => (attributeset) => (Object.entries(attributeset) ?? [])
    .forEach(([k, v]) => typeof v == 'undefined' ? node.removeAttribute(k) // FIXME: toggle/remove event listener, if matches /^on/
    : typeof v.subscribe == 'function' ? v.subscribe((DOMSinks.get(k) || attributeSink)(node, k))
        : typeof v.then == 'function' ? v.then((DOMSinks.get(k) || attributeSink)(node, k))
            : k == 'class' ? (v.then ? v.then(v => setClassX(node, v)) : v.subscribe ? v.subscribe(v => setClassX(node, v)) : setClassX(node, v))
                : k == 'style' ? setStyles(node, v)
                    : k.substr(0, 2) == 'on' && typeof (v.next || v) == 'function' ? node.addEventListener(k.replace(/^on/, ''), v.next ? v.next.bind(v) : v, { capture: true })
                        : k == 'value' ? node.value = v
                            : node.setAttribute(k, v));
