Pagination state needs a reliable signal for the final page. A missing cursor and an empty result are different conditions.
Worked example
type Page<T> = { items: T[]; next: string | null };
const page: Page<{ id: number }> = { items: [{ id: 1 }, { id: 2 }], next: "2" };
console.log(page.next !== null);Result
trueImplementation notes
Cursor pagination may return fewer records than requested and still offer another page. Prefer the API's explicit continuation token.
Try it yourself
Check a full final page and a short page that still carries a next cursor.
Open the TypeScript example →Editorial date April 22, 2026 · Published December 6, 2026