Classseedcordv0.15.0
CursorSource
A source for a large or unknown-length set you fetch one page at a time (SQL LIMIT/OFFSET, a paged API). The fetcher receives the page index and the page size and reports whether a next page exists. A cursor source has no cheap total, so totalPagestotalPages is undefined, the last button is omitted, and the indicator reads "Page X".
class CursorSource<Item> implements PageSource<Item>class CursorSource<Item> implements PageSource<Item>Member visibility
Filter class members by access level.
CursorSource(
fetch: (
ctx: PageContext,
page: number,
perPage: number
) => Promisable<{
items: readonly Item[];
hasNext: boolean;
}>,
opts?: { perPage?: number }
)CursorSource(
fetch: (
ctx: PageContext,
page: number,
perPage: number
) => Promisable<{
items: readonly Item[];
hasNext: boolean;
}>,
opts?: { perPage?: number }
)Showing members with Protected visibility and higher.
Methods
Item
The item type, inferred from the fetcher's slice.
ItemItempublic async page(
ctx: PageContext,
n: number
): Promise<PageView<Item>>public async page(
ctx: PageContext,
n: number
): Promise<PageView<Item>>