跳到主要内容

useInfiniteScroll()

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

Defined in: useInfiniteScroll.ts:44

用于游标分页的无限滚动钩子

Type Parameters

Type Parameter
T extends EntityType

Parameters

ParameterTypeDescription
EntityTypeT实体类
optionsUseOptions<EntityStaticType<T, "findByCursorOptions">>带有游标分页的查询选项

Returns

InfiniteScrollResource<InstanceType<T>>

包含无限滚动控制的资源对象

Example

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