Cookbook / Infinite Scroll

Infinite Scroll

list

Infinite scroll — controller() wires an IntersectionObserver sentinel that calls the loadMore action; each/key/empty renders the list.

id
infinite-scroll
since
0.5.0
file
infinite-scroll.aihu
propstateactioncontrolleronMounteachkeyemptygroupifinterpolation

Run it

source · static

This recipe doesn't have a hydrated island in the demo gallery yet. An in-browser, WASM-compiled playground (edit this source and re-render live) is planned as a follow-up — read the real source below.

Source

infinite-scroll.aihu

Requires

concerns
stateevents

Anti-patterns

  • Do not fire loadMore from the observer without checking loading — re-entrant calls double-append pages.

Related recipes