mol_wire_dom
v0.0.1218
Published
Polyfill makes DOM reactive.
Downloads
3,991
Maintainers
Keywords
Readme
$mol_wire_dom
Polyfill makes DOM reactive.
Proof of Concept. Very slow until real DOM isn't reactve.
Complete example. Online sandbox.
Make some DOM tree reactive
$mol_wire_dom( document.body )
Reactivity fully working only on connected DOM tree.
Add reactive rules
At any time you can define or redefine getter for some DOM node fields.
const root!: HTMLDIvElement
const form!: HTMLFormElement
const greet!: HTMLInputElement
const greeting!: HTMLParagraphElement
root.__defineGetter__( 'childNodes', ()=> greet.checked ? [ form, greeting ] : [ form ] )
So far, not all are supported yet. See sources for more info.