Dependent requests
Fetch a user first, then load their posts and todos only once the user id is known.
Pagination
Page through products with query params, keep the previous page on screen and prefetch the next one.
Infinite scroll
Load the next page of products as you scroll, with useInfiniteFetch and an IntersectionObserver.
Load more
Load pages on demand with a Load more button, start in the middle of a list and see where each page begins.
Search as you type
Search products while typing and send one request per pause with the bounce option of useFetch.
Polling
Refetch data on an interval with refresh and refreshTime, and pause polling in background tabs.
Refetch on focus
Refetch when the window gets focus, loses it or the network comes back, with a log of every trigger.
Suspense
Load data with React Suspense and handle failed requests in an error boundary with throwOnError.
Select
Read different parts of one cached response with the select option, and re-render only when that part changes.
Prefetching
Prefetch product details on hover with request.send(), so opening them shows cached data at once.
Parallel requests
Load several independent requests at once, each with its own loading state, and show a global indicator with useIsFetching.
URL filters
Keep search, sort and page in the URL query string and turn them into typed query params, with working back and forward.
Fetch on click
Send a request only when the user asks: useFetch with disabled, or request.send() for a one-off call.
Max pages
An infinite list that keeps only three pages with useInfiniteFetch maxPages and loads dropped pages again when you scroll back.
Chat history
A chat that opens at the newest messages and loads older ones with fetchPreviousPage as you scroll up, keeping your place.
Data table
A product table with server-side sorting, search and pagination that keeps the previous rows on screen while the next ones load.
Download progress
Download a file with a live percentage, speed and time left from onDownloadProgress, then save it from a Blob.