()
| 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(() => ({ |