Bite-sized virtual-dom
/** @jsx h */
import {h, loop, component} from 'omom'
let List = component(({items}) => {
items = items.map((item) => {
return <li>{item}</li>
})
return (
<ul>{items}</ul>
)
})
let app = ({className, items}) => {
return (
<div className={className}>
<List items={items} />
</div>
)
}
let createInitialState = loop(document.body, render)
let update = createInitialState({className: 'foobar', items: ['foo', 'bar']})
// performs update
update({className: 'foobar', items: ['foo', 'bar', 'baz']})
npm install --save omom
npm install
npm test
make test
- Rob Pike's state functions
- Mike Bostock's Reusable Charts
- virtual-dom
- mercury
- deku