function useLoadMore
useLoadMore<T>(
list: PagedList<T> | null,
setList: (fn: (list: PagedList<T>) => PagedList<T>) => void,
fetchPage: FetchPage<T>
): () => void

Returns the call that loads the page after list's last one and appends it through setList. It does nothing unless canLoadMore(list); a page that fails leaves the list as it was, for the next call to try again. A page that loads its list along with more, as the search page does, uses it directly, and usePagedList for the others.

Type Parameters

Parameters

list: PagedList<T> | null
setList: (fn: (list: PagedList<T>) => PagedList<T>) => void
fetchPage: FetchPage<T>

Return Type

() => void

Usage

import { useLoadMore } from "src/hooks/feed/usePagedList.ts";