UNPKG

reablocks

Version:
28 lines (27 loc) 766 B
export interface InfinityListInputs { /** * The array of items to page on. */ items: any[]; /** * The page size. Combined with the threshold, this will determine the page size. * @default 10 */ size?: number; /** * The fuzzy threshold to use when calculating the next page size. * @default 3 */ threshold?: number; /** * The numer of items to show in the next page. If undefined, will use the size. * If you want to show all items, pass infinity. */ nextSize?: number; } export declare const useInfinityList: ({ items, threshold, size, nextSize }: InfinityListInputs) => { data: any[]; hasMore: boolean; remaining: number; showNext: (amount?: number) => void; };