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

Function List

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useInfiniteQueryFunction · 0.50

Tested by

no test coverage detected