swr
Version:
React Hooks library for remote data fetching
5 lines (4 loc) • 564 B
TypeScript
import { ValueKey, Fetcher, SWRInfiniteConfiguration, SWRInfiniteResponse } from './types';
declare type KeyLoader<Data = any> = (index: number, previousPageData: Data | null) => ValueKey;
declare function useSWRInfinite<Data = any, Error = any>(...args: readonly [KeyLoader<Data>] | readonly [KeyLoader<Data>, Fetcher<Data>] | readonly [KeyLoader<Data>, SWRInfiniteConfiguration<Data, Error> | undefined] | readonly [KeyLoader<Data>, Fetcher<Data>, SWRInfiniteConfiguration<Data, Error> | undefined]): SWRInfiniteResponse<Data, Error>;
export { useSWRInfinite };