function usePagedList
usePagedList<T extends { id: string; }>(
key: string | undefined,
fetchPage: FetchPage<T>,
cached?: Omit<FeedCacheEntry<T>, "savedAt"> | null
): UsePagedListResult<T>

Returns the list fetchPage serves for key, from its first page, and the call that loads the next. key changes as useFetchState's does, and cached, useFeedCache's restored list for it, if any, is shown without loading. The index's feeds, the profile's lists, the notifications and the popover of voters and likers use it.

Type Parameters

T extends { id: string; }

Parameters

key: string | undefined
fetchPage: FetchPage<T>
optional
cached: Omit<FeedCacheEntry<T>, "savedAt"> | null

Return Type

Usage

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