Loads a feed's next page when the end of the feed scrolls into view.

Functions

f
useInfiniteScroll(
onLoadMore: () => void,
enabled: boolean
): (node: HTMLDivElement | null) => void

Returns a callback ref for the sentinel element placed after a feed's last item, and calls onLoadMore when the sentinel comes within 200px of the view while enabled. Feed pages pass canLoadMore of their list.

Usage

import * as mod from "src/hooks/feed/useInfiniteScroll.ts";