Replies: 1 comment 1 reply
-
The standard answer would be to use the query hooks to access the data rather than trying to manually call If you truly only ever have a single result from this endpoint, you could use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
I'd like to migrate from just RTK to RTKQ.
I have a scenario where i am struggling. I have a search form with about a dozen search parameters. the api accepts any combination of search criteria. i make an api call on the search form using thunks/redux and put the result into one redux slice. it doesn't matter what search criteria is used the data will always be in the same place in the store.
then in multiple other components i use useSelector to access the search results.
With RTKQ i know i can access the results also in redux but the query signature always changes if the search criteria changes.
i.e. there is always a new query in the store where the data sits. So it is difficult to get to that data . i think i would have to store the search criteria in redux and then use those in the other components to find the query or "re-execute" the query.
is there a way to always put the results into the same location in the store in RTKQ. i.e. basically ignoring the arguments . this is how it works right now for me just using RTK
or is there an easier way to find the data in RTKQ. like when a new search is made can i "kill" all the existing queries that start with the same query name "fetchApplicationsBySearchCriteria" so i always only have one and then maybe there is a way to find that in state without knowing the parameters that were used?
btw i don't want any caching because this is a multi user app so a search should always get the latest data.
Any help would be greatly appreciated.
Thank you
Fabian
Beta Was this translation helpful? Give feedback.
All reactions