hyperlist-component

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i hyperlist-component

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • timwis