Scroll listeners

"Scroll" event is attached to the scrollable container.

Each time an scroll event is triggered, the scroll position is checked and if the user has scrolled to the bottom of the container then 1 row is appended to the DOM, and the scroll position is checked again in a recursive way.

Intersection observer

An "Intersection Observer" is attached to the scrollable container and a "sentinel" (empty element) is placed on the bottom of the container.

Each time the sentinel enters in the viewport, multiple rows are inserted to the document until the sentinel leaves the viewport.