Questions tagged [rtk]

Real Time Kinematic Is a satellite navigation technique used to enhance the precision of position data derived from satellite-based positioning systems (global navigation satellite systems, GNSS) such as GPS, BeiDou, GLONASS, Galileo, etc

106 questions
20
votes
3 answers

How to invalidate RTK query caches(reset state) globally?

Project uses redux toolkit and rtk query. Data are fetched from one api, but the code is split into smaller chunks to reflect logical parts like /vehicles /users /settings ...etc After logout rtk query preserves its state, so on next login the…
Dmitry Avgustis
  • 854
  • 1
  • 9
  • 14
12
votes
1 answer

How to implement multiple api call in a single query with RTK query

I'm new in RTK Query and I'm struggling with a use case I have to implement. Scenario: I have to merge the results from two API calls: the first API call is a private API call while the second one is a public API call. I need to merge the responses…
lucataglia
  • 728
  • 5
  • 18
6
votes
1 answer

How to get X-Total-Count header with RTK Query?

Don't know how to access the headers after the request. Documentation examples without using x-total-count const guitarApi = createApi({ reducerPath: 'GUITARS', baseQuery: fetchBaseQuery({ baseUrl: API_URL }), endpoints: (builder) => ({ …
v.zdorovcev
  • 71
  • 2
  • 6
6
votes
1 answer

Is there a way for an Android device to function as an NTRIP client?

I have an NTRIP caster that I'm supposed to communicate with from an Android application, via RTCM 3.0, to perform RTK. Is there an Android or at least Java implementation of the NTRIP protocol available somewhere? I didn't find any that looked…
zsmb13
  • 85,752
  • 11
  • 221
  • 226
5
votes
1 answer

What is the recommended way to perform multiple mutations in sequence in RTK Query?

Which way is recommended to perform multiple mutations in sequence using RTK Query? const [ updateProfile, ] = useUpdateProfileMutation(); const [ updatePost, ] = useUpdatePostMutation(); const performMutipleMuations = async ()…
dan_boy
  • 1,735
  • 4
  • 19
  • 50
5
votes
2 answers

how can I save data into localStorage in RTK query?

I want to create a cart that contain list of products that user added and save it in localStorage. if we have this code for RTK query is that possible to define that cart inside the createApi() ? if not, how can I use it in another slice? export…
sarem eskandary
  • 504
  • 4
  • 16
5
votes
1 answer

Redux ToolKit Query - Make multiple queries in the same component dependant on each other

I'm trying to use RTK Query in a NextJS app to fetch multiple entities from an API. I have the App and AppVersion models. When the component loads I need to fetch the App and then fetch the appropriate AppVersions. An App has the currentVersionId…
adrianthedev
  • 626
  • 1
  • 11
  • 21
4
votes
1 answer

How to use useQuery with React Async Select

https://react-select.com/async: React async Select Library https://redux-toolkit.js.org/rtk-query/overview: RTK Query How to utilise the methods provided by useQuery with React Async library. I was unable to utilise this because refetch does not…
kshitiz saini
  • 165
  • 1
  • 9
4
votes
2 answers

Redux Tool Kit Query: Need same data in different two components but without duplicate requests

I'm new to rtk and rtk query , I'm using rtk query. I have two components I need the same data for each, I do not want to call the function twice in each component to get the same data, is there a way to only call it one time then for better…
4
votes
1 answer

Is it possible to optimistically update all caches of a endpoint?

In the redux tutorial, we learned how to perform optimistic updates: part-8-rtk-query-advanced#implementing-optimistic-updates But in the API reference of updateQueryData, I found that an args must be passed in: const updateQueryData = ( …
Grapes
  • 221
  • 2
  • 10
3
votes
1 answer

How to extract selectors from adapter from queries with arguments

I'm trying to extract selectors from queries in my apiSlice as said in this documentation: https://redux.js.org/tutorials/essentials/part-8-rtk-query-advanced The documentation put this example: const usersAdapter = createEntityAdapter() const…
3
votes
1 answer

RTK Query: Accessing cached data outside of a react component

We are in the process of integrating RTK query in our app. Our current "architecture" is as follow: All the business logic actions are written inside services which are plain JS classes. Those services are passed using react context in order for the…
Clement
  • 3,860
  • 4
  • 24
  • 36
3
votes
1 answer

Why is the cleanup of an useEffect hook seeing the result of an RTKQ as isLoading and how to avoid the issue?

I have a React function component (a route component) that should do something when it is unmounted (i.e. the user clicks the browser Back button) and contains the following relevant lines: // ... const params = useParams(); //…
silviubogan
  • 3,343
  • 3
  • 31
  • 57
2
votes
1 answer

RTK useLazyQuery trigger onClick data not refreshed

I'm a newbie on RTK queries and I currently have this problem What i'm trying to do here is after trigger(), i need to access result in the onClickHandler to process, but when i console.log the result, i keep getting the initObject of { …
John Z
  • 129
  • 1
  • 7
2
votes
2 answers

RTK Query doesn't handle text response

We have a basic RTK API Slice that based on fetchBaseQuery just like recommended on RTK documentation. Also, there is a backend service that returns data as a text in a response, but declared as a Content-Type: application/json on Response Header. I…
oyilmaztekin
  • 713
  • 1
  • 7
  • 25
1
2 3 4 5 6 7 8