Skip to content

wrapper around virtual-dom to return an update(tree) method

Notifications You must be signed in to change notification settings

twilson63/update-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

update-dom

A wrapper around the virtual-dom module that provides an update function.

const dom = require('update-dom')
const h = require('update-dom/h')

const update = dom(
  h('h1', ['Hello World'])
, document.querySelector('main')
)

// now I can update the dom using update
update(
  h('h1', ['Good Bye'])
)

Dependencies

  • virtual-dom

API

(tree, [ parent ]) -> update(newTree)

When requiring the module it returns a function that takes a virtualDom Tree and optional parent node, then returns an update function that takes the new virtualDom Tree. This function should be called every time you want to update the dom.

LICENSE

MIT

Contributions

Bug Fixes welcome!

About

wrapper around virtual-dom to return an update(tree) method

Resources

Stars

Watchers

Forks

Packages

No packages published