🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

infinilist

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infinilist

hui component for partial rendering big lists

latest
Source
npmnpm
Version
1.2.5
Version published
Maintainers
2
Created
Source

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

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`<li>${items[i]}</li>`
}

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.

Keywords

infinite

FAQs

Package last updated on 12 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts