Micro Virtual List
Virtual lists with customizable heights on each elements.
Usually on virtual list libraries you have to specify a fixed height. This module allows you to specify a height per row.
Installation
npm install micro-virtual-list --save
Usage
Simple
const container = document
Dynamic heights
const container = documentconst total = 10000const itemHeight = 70 // must be the Max height for better results (Math.max.apply(null, heightsArray)) // random heightsconst heights = total
Public methods
let config = total: 100 height: 400 itemHeight: 200 { let el = document elinnerText = 'Row: ' + i return el } const virtualList = window { configheight = 500 virtualList}
You can also use virtualList.destroy()
(internally executes cancelAnimationFrame
)