Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hyperdivision/infinilist
Scalable list element
https://github.com/hyperdivision/infinilist
Last synced: 18 days ago
JSON representation
Scalable list element
- Host: GitHub
- URL: https://github.com/hyperdivision/infinilist
- Owner: hyperdivision
- Created: 2020-03-25T16:49:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-04-12T17:13:53.000Z (over 4 years ago)
- Last Synced: 2024-05-16T14:43:34.807Z (6 months ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Infinilist
> hui component for listing a millions of items, partially rendering only a
> viewport and viewport buffer amount of them, using a single intersection observer## Usage example
``` js
const Infinilist = require('infinilist')
const html = require('hui/html')const items = [ ...millionsOfItems ]
// render function passed down to list, requesting a rendered item at index
const renderItem (i) {
return html`
}
const list = new Infinilist(renderItem, { total: items.length })
document.body.appendChild(list.element)
```
## API
#### `list.resize(newTotalCount)`
Update the total count after the element has been created
#### `list.reset()`
Recreates all currently showed elements. Useful if your underlying array changes.