Infinite scrolling component that works with any DOM structure and loads content lazily.
There needs to be an outer and an inner element, the outer element having
The rest is up to you:
const Unendlich =const html =const rows =for let i = 0; i < 1e5; i++rowsconst inner = html``const outer = html``documentbodyconst example =rowsinnerouterhtml`: ()`page: 100padding: 50
A row element can also by an
async function, which will then be resolved before rendering:
const rows =async
$ npm install unendlich
Create a new instance and
For extra performance, pass
update which takes existing old row elements and updates them, instead of
creating new ones. For example:
html`: ()`elinnerHTML = `: ()`
Force a render, if
true it will also rerender already rendered rows.
Update the row content. Doesn't trigger a rerender by itself.
Update the #outer element's height. Example: