useQueries for running multiple dynamic disjoint queries that populate different cache keys #603
segevfiner
started this conversation in
Ideas
Replies: 2 comments 7 replies
-
Using a component is great, it relies on Vue and its existing lifecycle, it probably is what you need |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
But how would I handle this with a component like this: https://primevue.org/tree/, Do I just need to add an empty/functional components just for calling useQuery in a loop? Wouldn't it be easier if there was something builtin for this? |
Beta Was this translation helpful? Give feedback.
7 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.
-
If I have a component that has a computed/dynamic array of items to fetch, where each one has its own cache key and I don't want to materialize a separate component for each query, I'm currently stuck, as there doesn't seem to be an appropriate composable that can take an array of queries that dynamically change an activate/deactivate them at runtime from that single composable call.
useQuerycan't otherwise be used outside of setup context being a composable so I can't just call it dynamically from some other effect or event without some hack around that.useInfiniteQueryseems only appropriate when it's just one cache key/array of data that dynamically expands, rather than a bunch of disjoint queries.Hit this with a tree component where I need to fetch the data dynamically depending on the expanded nodes reported by the component.
Beta Was this translation helpful? Give feedback.
All reactions