MCPcopy Create free account
hub / github.com/TanStack/query / List

Function List

packages/solid-query/src/__tests__/useInfiniteQuery.test.tsx:1227–1243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1225 const initialData = { pages: [1, 2, 3, 4], pageParams: [0, 1, 2, 3] }
1226
1227 function List() {
1228 useInfiniteQuery(() => ({
1229 queryKey: key,
1230 queryFn: ({ pageParam }) =>
1231 sleep(50).then(() => {
1232 fetches++
1233 return pageParam * 10
1234 }),
1235 initialData,
1236 getNextPageParam: (_, allPages) => {
1237 return allPages.length === 4 ? undefined : allPages.length
1238 },
1239 initialPageParam: 0,
1240 }))
1241
1242 return null
1243 }
1244
1245 function Page() {
1246 const [show, setShow] = createSignal(true)

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useInfiniteQueryFunction · 0.50

Tested by

no test coverage detected