T
TanStack3y ago
foreign-sapphire

How to utilize useQuery to update multiple variables?

Currently I am passing multiple reactive variables into useQuery and setting there values in the select function as well as cross referencing data from different endpoints to generate newly formatted data. this works but im not sure if this is the best design. since the useQuery is triggered whenever the querykey changes it makes it easy for these values to be updated along with the new request. but should i use using a watcher in the component to update these values? the select function logic is specific to the particular endpoint so maybe the data returned by usequery should be a object storing different data types that can be separated out in the component that is calling usequery
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?