ahooks
Version:
react hooks library
17 lines (16 loc) • 633 B
TypeScript
/// <reference types="react" />
import type { Data, InfiniteScrollOptions, Service } from './types';
declare const useInfiniteScroll: <TData extends Data>(service: Service<TData>, options?: InfiniteScrollOptions<TData>) => {
data: TData | undefined;
loading: boolean;
error: Error | undefined;
loadingMore: boolean;
noMore: boolean;
loadMore: () => void;
loadMoreAsync: () => Promise<TData>;
reload: () => void;
reloadAsync: () => Promise<TData>;
mutate: import("react").Dispatch<import("react").SetStateAction<TData | undefined>>;
cancel: () => void;
};
export default useInfiniteScroll;