UNPKG

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