mol_wire_dom
TypeScript icon, indicating that this package has built-in type declarations

0.0.1185 • Public • Published

$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.

Dependents (0)

Package Sidebar

Install

npm i mol_wire_dom

Weekly Downloads

1,012

Version

0.0.1185

License

none

Unpacked Size

1.34 MB

Total Files

27

Last publish

Collaborators

  • jin