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

Function FirstComponent

packages/solid-query/src/__tests__/useQuery.test.tsx:1378–1394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1376 const states: Array<UseQueryResult<number>> = []
1377
1378 function FirstComponent() {
1379 const state = useQuery(() => ({
1380 queryKey: key,
1381 queryFn: () => sleep(10).then(() => 1),
1382 }))
1383
1384 createRenderEffect(() => {
1385 states.push({ ...state })
1386 })
1387
1388 return (
1389 <div>
1390 <button onClick={() => state.refetch()}>refetch</button>
1391 data: {state.data}
1392 </div>
1393 )
1394 }
1395
1396 function SecondComponent() {
1397 useQuery(() => ({

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
refetchMethod · 0.80
useQueryFunction · 0.50

Tested by

no test coverage detected