# ArraySource

`class` in `seedcord` · v0.15.0

<https://docs.seedcord.org/packages/seedcord/0.15.0/classes/array-source>

A source for a bounded list you can load whole. It loads the full list on every click, then slices the page via [`paginate`](/packages/kit/0.2.0/functions/paginate), so the real total is known (a real last button, "Page X of Y"). Cache inside your loader if the load is expensive.

```ts
class ArraySource<Item> implements PageSource<Item>
```

## Constructors

### constructor

```ts
ArraySource(
    load: (ctx: PageContext) => Promisable<readonly Item[]>,
    opts?: { perPage?: number }
)
```

Constructs a new instance of the `ArraySource` class

## Methods

### page

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