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

0.0.967 • 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.

Package Sidebar

Install

npm i mol_wire_dom

Weekly Downloads

406

Version

0.0.967

License

none

Unpacked Size

1.26 MB

Total Files

27

Last publish

Collaborators

  • jin