timwis / hyperlist-component

Wraps HyperList with Nanocomponent to allow use as a pureish component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Wraps HyperList with Nanocomponent to allow use as a pureish component.


Languages

Language:JavaScript 100.0%