UNPKG

633 BTypeScriptView Raw
1/// <reference types="react" />
2import type { Data, InfiniteScrollOptions, Service } from './types';
3declare const useInfiniteScroll: <TData extends Data>(service: Service<TData>, options?: InfiniteScrollOptions<TData>) => {
4 data: TData | undefined;
5 loading: boolean;
6 error: Error | undefined;
7 loadingMore: boolean;
8 noMore: boolean;
9 loadMore: () => void;
10 loadMoreAsync: () => Promise<TData>;
11 reload: () => void;
12 reloadAsync: () => Promise<TData>;
13 mutate: import("react").Dispatch<import("react").SetStateAction<TData | undefined>>;
14 cancel: () => void;
15};
16export default useInfiniteScroll;