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

Function Component

packages/solid-query/src/__tests__/suspense.test.tsx:357–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355 let count = 0
356
357 function Component() {
358 const result = useQuery(() => ({
359 queryKey: key,
360 queryFn: () => sleep(100).then(() => ++count),
361 retry: false,
362 suspense: true,
363 staleTime: 0,
364 }))
365
366 return (
367 <div>
368 <span>data: {result.data}</span>
369 <span>fetching: {result.isFetching ? 'true' : 'false'}</span>
370 </div>
371 )
372 }
373
374 function Page() {
375 const [show, setShow] = createSignal(true)

Callers

nothing calls this directly

Calls 2

sleepFunction · 0.90
useQueryFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…