Package Exports
- vdom-list
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vdom-list) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vdom list
Show lists of things with a virtual dom
install
$ npm install vdom-listexample
var vdom = require('virtual-dom');
var h = vdom.h;
var List = require('../List.js');
function Link(url, words) {
return h('a', {href: url}, [words]);
}
var state = List({
items: [
{
name: 'location',
children: ['seattle', 'olympia', 'tangier']
},
{
name: 'meats',
children: [
Link('ham', 'ham'),
Link('fish', 'some kinds of fish'),
Link('hot-dogs', 'hot dogs')
]
}
]
});
var loop = require('main-loop')( state(), List.render.bind(null, h), vdom );
state(loop.update);
document.getElementById('content').appendChild(loop.target);