# CursorSourceBase

`class` in `core` · v0.6.0

<https://docs.seedcord.org/packages/core/0.6.0/classes/cursor-source-base>

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 `totalPages` is undefined, the last button is omitted, and the indicator reads "Page X".

```ts
class CursorSourceBase<Item, Ctx> implements PageSourceBase<Item, Ctx>
```

## Constructors

### constructor

```ts
CursorSourceBase(
    fetch: (
        ctx: Ctx,
        page: number,
        perPage: number
    ) => Promisable<{
        items: readonly Item[];
        hasNext: boolean;
    }>,
    opts?: { perPage?: number }
)
```

Constructs a new instance of the `CursorSourceBase` class

## Methods

### page

```ts
public async page(
    ctx: Ctx,
    n: number
): Promise<PageView<Item>>
```
