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

0.0.1224 • 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

674

Version

0.0.1224

License

none

Unpacked Size

1.38 MB

Total Files

27

Last publish

Collaborators

  • jin