hyperlist-component
v0.1.0
Published
Wraps [HyperList][1] with [Nanocomponent][2] to allow use as a pureish component.
Downloads
6
Readme
HyperList Component
Wraps HyperList with Nanocomponent to allow use as a pureish component.
Usage
const html = require('bel')
const HyperList = require('hyperlist-component')
const opts = {
height: 500,
itemHeight: 30,
eachItem: (state, index) => html`<li>${state.items[index]}</li>`,
getTotal: (state) => state.items.length
}
const hyperList = new HyperList('ul', opts)
const ul = hyperList.render({ items: [1, 2, 3] }) // can be called repeatedly