-
I currently use onSettled to update state (runsData), and when runsData is updated I check if the queryCache has all the data I'd expect when all 3 queries have run. I'm sure there must be an easier way to check when all the queries have finished, and then do something with the results.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think there must be something more simple. Do you really need to get the data from the cache? I would consider it done if all the queries are in
problem is, you can't really depend on the data in your effect, because it would likely be a new array in every render, thus executing the effect every time. You could work around this with a ref, or with reading from he queryClient with getQueryData once |
Beta Was this translation helpful? Give feedback.
I think there must be something more simple. Do you really need to get the data from the cache? I would consider it done if all the queries are in
success
state, so something like:problem is, you can't really depend on the data in your effect, because it would likely be a new ar…