MCPcopy
hub / github.com/TanStack/query / Page

Function Page

packages/solid-query/src/__tests__/useQueries.test.tsx:46–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 const results: Array<Array<UseQueryResult>> = []
45
46 function Page() {
47 const result = useQueries(() => ({
48 queries: [
49 {
50 queryKey: key1,
51 queryFn: async () => {
52 await sleep(10)
53 return 1
54 },
55 },
56 {
57 queryKey: key2,
58 queryFn: async () => {
59 await sleep(100)
60 return 2
61 },
62 },
63 ],
64 }))
65
66 createRenderEffect(() => {
67 results.push([{ ...result[0] }, { ...result[1] }])
68 })
69
70 return (
71 <div>
72 <div>
73 data1: {String(result[0].data ?? 'null')}, data2:{' '}
74 {String(result[1].data ?? 'null')}
75 </div>
76 </div>
77 )
78 }
79
80 const rendered = render(() => (
81 <QueryClientProvider client={queryClient}>

Callers

nothing calls this directly

Calls 10

sleepFunction · 0.90
toStringMethod · 0.80
getQueryKeyAFunction · 0.70
getQueryFunctionAFunction · 0.70
getQueryKeyBFunction · 0.70
getQueryFunctionBFunction · 0.70
getSelectorAFunction · 0.70
getSelectorBFunction · 0.70
useWrappedQueriesFunction · 0.70
useQueriesFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…