# pageFromLookahead

> **pageFromLookahead**\<`T`\>(`source`, `limit`, `getNextCursor`): [`Page`](/reference/filoz/synapse-core/core/type-aliases/page/)\<`T`\>

Defined in: [packages/synapse-core/src/pagination.ts:46](https://github.com/FilOzone/synapse-sdk/blob/e6fb33f57d00c5c775ea37a127e65446e2eee635/packages/synapse-core/src/pagination.ts#L46)

Convert a contract response fetched with `limit + 1` into a bounded page.

The extra item is used only to detect whether another page exists. When it
does, the item is removed and `getNextCursor` derives the continuation
cursor from the last visible item.

## Type Parameters

| Type Parameter |
| ------ |
| `T` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `source` | readonly `T`[] |
| `limit` | `bigint` |
| `getNextCursor` | (`lastItem`) => `bigint` |

## Returns

[`Page`](/reference/filoz/synapse-core/core/type-aliases/page/)\<`T`\>