useInfiniteScroll()
function useInfiniteScroll<T>(EntityType, options): InfiniteScrollResource<InstanceType<T>>;
Defined in: useInfiniteScroll.ts:44
用于游标分页的无限滚动钩子
Type Parameters
| Type Parameter |
|---|
T extends EntityType |
Parameters
| Parameter | Type | Description |
|---|---|---|
EntityType | T | 实体类 |
options | UseOptions<EntityStaticType<T, "findByCursorOptions">> | 带有游标分页的查询选项 |
Returns
InfiniteScrollResource<InstanceType<T>>
包含无限滚动控制的资源对象
Example
const resource = useInfiniteScroll(Todo, {
where: { completed: false },
orderBy: [{ field: 'createdAt', sort: 'desc' }],
limit: 50
});