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

Function List

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

Source from the content-addressed store, hash-verified

1212 const initialData = { pages: [1, 2, 3, 4], pageParams: [0, 1, 2, 3] }
1213
1214 function List() {
1215 useInfiniteQuery(() => ({
1216 queryKey: key,
1217 queryFn: ({ pageParam }) =>
1218 sleep(50).then(() => {
1219 fetches++
1220 return pageParam * 10
1221 }),
1222 initialData,
1223 getNextPageParam: (_, allPages) => {
1224 return allPages.length === 4 ? undefined : allPages.length
1225 },
1226 initialPageParam: 0,
1227 }))
1228
1229 return null
1230 }
1231
1232 function Page() {
1233 const [show, setShow] = createSignal(true)

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useInfiniteQueryFunction · 0.50

Tested by

no test coverage detected