InfiniteScroller

Primitive #43

๐Ÿ” Problem it solves

When the user scrolls near the bottom of a list, more items should load automatically (e.g., social media feed). Manually checking scroll position and calling an API leads to duplicate requests.

โœ… Solution

InfiniteScroller detects scroll position near bottom (configurable threshold), triggers a loadMore callback, and manages loading state to prevent multiple simultaneous requests. It provides a hasMore flag and cleanup.

๐Ÿงฉ Used by components

FeedList, SearchResults, MessageThread, ProductCatalog, CommentSection

๐ŸŽฎ Interactive demo