Open History to see the last commit
1import { QueryClient } from '@tanstack/query-core'
2import { createCursorPager as createProductionPager } from '../../src/index.js'
3import type { FetchPage } from './backend.js'
4
5/** Stable-snapshot tests use isolated caches without timers or expiry. */
6export function createCursorPager<T>(fetchPage: FetchPage<T>) {
7 return createProductionPager({
8 queryClient: new QueryClient({
9 defaultOptions: { queries: { retry: false } },
10 }),
11 queryKey: [`cursor-pages`],
12 staleTime: Infinity,
13 gcTime: Infinity,
14 fetchPage,
15 })
16}