https://github.com/timwis/hyperlist-component
Wraps HyperList with Nanocomponent to allow use as a pureish component.
https://github.com/timwis/hyperlist-component
Last synced: 24 days ago
JSON representation
Wraps HyperList with Nanocomponent to allow use as a pureish component.
- Host: GitHub
- URL: https://github.com/timwis/hyperlist-component
- Owner: timwis
- Created: 2017-04-23T16:57:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-25T10:48:56.000Z (about 8 years ago)
- Last Synced: 2025-03-25T08:42:46.649Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 6
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HyperList Component
Wraps [HyperList][1] with [Nanocomponent][2] to allow use as a pureish
component.## Usage
```javascript
const html = require('bel')
const HyperList = require('hyperlist-component')const opts = {
height: 500,
itemHeight: 30,
eachItem: (state, index) => html`
getTotal: (state) => state.items.length
}
const hyperList = new HyperList('ul', opts)
const ul = hyperList.render({ items: [1, 2, 3] }) // can be called repeatedly
```
[1]: https://github.com/tbranyen/hyperlist/
[2]: https://github.com/yoshuawuyts/nanocomponent/