by dpweb · 2mo ago · 0 comments
window.state = new Proxy({}, {
set(target, key, value) {
target[key] = value
document.querySelectorAll(`[data="${key}"]`)
.forEach(el => el.render?.())
return true
}
})
handles reactivity.. https://github.com/digplan/vanilla-lightImho, custom elements are great, but very limited in a way that they almost always require knowledge of the domain.
Perhaps I can figure out a way to combine mador.js & custom elements.