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

Function FirstComponent

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

Source from the content-addressed store, hash-verified

1409 const states: Array<UseQueryResult<number>> = []
1410
1411 function FirstComponent() {
1412 const state = useQuery(() => ({
1413 queryKey: key,
1414 queryFn: () => sleep(10).then(() => 1),
1415 }))
1416
1417 createRenderEffect(() => {
1418 states.push({ ...state })
1419 })
1420
1421 return (
1422 <div>
1423 <button onClick={() => state.refetch()}>refetch</button>
1424 data: {state.data}
1425 </div>
1426 )
1427 }
1428
1429 function SecondComponent() {
1430 useQuery(() => ({

Callers

nothing calls this directly

Calls 3

sleepFunction · 0.90
refetchMethod · 0.80
useQueryFunction · 0.50

Tested by

no test coverage detected