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