MCPcopy Index your code
hub / github.com/TanStack/query / fetchItems

Function fetchItems

packages/react-query/src/__tests__/useInfiniteQuery.test.tsx:33–46  ·  view source on GitHub ↗
(
  page: number,
  ts: number,
  noNext?: boolean,
  noPrev?: boolean,
)

Source from the content-addressed store, hash-verified

31const pageSize = 10
32
33const fetchItems = async (
34 page: number,
35 ts: number,
36 noNext?: boolean,
37 noPrev?: boolean,
38): Promise<Result> => {
39 await sleep(10)
40 return {
41 items: [...new Array(10)].fill(null).map((_, d) => page * pageSize + d),
42 nextId: noNext ? undefined : page + 1,
43 prevId: noPrev ? undefined : page - 1,
44 ts,
45 }
46}
47
48describe('useInfiniteQuery', () => {
49 beforeEach(() => {

Callers 2

PageFunction · 0.70
MyComponentFunction · 0.70

Calls 1

sleepFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…