()
| 1394 | const states: Array<UseQueryResult<number>> = [] |
| 1395 | |
| 1396 | function FirstComponent() { |
| 1397 | const state = useQuery(() => ({ |
| 1398 | queryKey: key, |
| 1399 | queryFn: () => sleep(10).then(() => 1), |
| 1400 | })) |
| 1401 | |
| 1402 | createRenderEffect(() => { |
| 1403 | states.push({ ...state }) |
| 1404 | }) |
| 1405 | |
| 1406 | return ( |
| 1407 | <div> |
| 1408 | <button onClick={() => state.refetch()}>refetch</button> |
| 1409 | data: {state.data} |
| 1410 | </div> |
| 1411 | ) |
| 1412 | } |
| 1413 | |
| 1414 | function SecondComponent() { |
| 1415 | useQuery(() => ({ |