跳到主要内容

useInfiniteScroll()

function useInfiniteScroll<T>(EntityType, options): InfiniteScrollResource<InstanceType<T>>;

Defined in: useInfiniteScroll.ts:33

Infinite scroll hook for cursor-based pagination

Type Parameters

Type Parameter
T extends EntityType

Parameters

ParameterTypeDescription
EntityTypeTThe entity class
optionsUseOptions<EntityStaticType<T, "findByCursorOptions">>Query options with cursor pagination

Returns

InfiniteScrollResource<InstanceType<T>>

A resource object with infinite scroll controls

Example

const resource = useInfiniteScroll(Todo, {
where: { completed: false },
orderBy: [{ field: 'createdAt', sort: 'desc' }],
limit: 50
});