Replies: 1 comment
-
|
This is also somewhat similar to what I'm trying to achieve: #100 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 a situation that i need to call an api multiple times in paralel with different params.
Created a composable that accepts an argument and uses that as key to query and also passes to fetch method
created a method so i can call this query in a loop and my expectation was that it won't be called again unless i invalidate the cache
This method is called in a modal component which is mounted on visible.
I had to use
await refresh()because if not initial values will be null. But this causes refetching after some try even though data is still in the cache.I found the solution to run refresh only if data is not exists but i dont think this is the right approach.
Maybe api will return empty data or throw error in first try. I can consider all and add more conditions but it gets messy and i din't want it.
Maybe there is a better way.
Here a reproduction link of stackblitz with similar setup.
Beta Was this translation helpful? Give feedback.
All reactions