cacheDataLoaded resolved after isLoading #1621
-
|
Imagine I have an API with two endpoints:
When I'm calling the At the moment I use the I've recreated this example here: https://codesandbox.io/s/serene-kepler-vg8qy When running the example, you can see a request is made to In I would have imagined that So is it the expected behavior? How would you have done that? NB: I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Yes, that is to be expected. To be honest, I don't think of a nice solution for you here from the back of my head. Personally, I would really not do any of that "filling up other endpoints from a result" things. |
Beta Was this translation helpful? Give feedback.
Yes, that is to be expected.
cacheDataLoadedresolves as part of a middleware that reacts to thefulfilledaction - and runs after the reducer, as the reducer is synchronous whilecacheDataLoadedis a promise that will only resolve on the next tick.To be honest, I don't think of a nice solution for you here from the back of my head. Personally, I would really not do any of that "filling up other endpoints from a result" things.
If you never want to make an actual request,
useQueryStatemight be an option instead ofuseQuery.