Replies: 3 comments 5 replies
-
Would really appreciate any help :) |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. Any suggestions will be helpful. |
Beta Was this translation helpful? Give feedback.
-
not sure I fully understand this. if you invalidate queryA, you'll show stale data for A & B while it's fetching, and after A has completed, you'll see new data for A and still the same data for B. Where is the brief inconsistency here ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have 2 different data sources which have different fetching times and fetch the data in parallel using two useQuery hooks.
The data sources have related data.
In my frontend I am using isSuccess/isPending to show a loading indicator until both queries have finished processing.
If one query now gets invalidated (manually or as it becomes stale), for a brief moment, there is a UI inconsistency as one query shows the stale data and the other shows the data which has just been refreshed. I don't want to show another loading indicator on isFetching as its a bad UX.
How should I deal with that?
My current solution on a high level (which feels a bit hacky):
And then in the frontend, I can be sure that the data between query A and B is in sync.
Beta Was this translation helpful? Give feedback.
All reactions