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
2
votes
1 answer

How to generate a custom cache entry on RTK query without async calls

I have a micro-frontend architecture and I'd like to understand if it is possible to update the cache of RTK query in a custom way without doing an API Call. I'm using Single-SPA to implement my micro-frontend architecture and from the…
lucataglia
  • 728
  • 5
  • 18
2
votes
1 answer

When is the cacheEntryRemoved promise fulfilled?

The docs say this: cacheEntryRemoved - A Promise that allows you to wait for the point in time when the cache entry has been removed from the cache, by not being used/subscribed to any more in the application for too long or by dispatching…
silviubogan
  • 3,343
  • 3
  • 31
  • 57
2
votes
1 answer

cant get redux toolkit to work with async (createAsyncThunk)

Hello stackOverflow friends. I'm starting to use redux toolkit, and there is some stuff that I don't get. I have this Slice: const envSlice = createSlice({ name: "env", initialState: { envs: [], loading: false, error: false }, reducers: {}, …
Daniel
  • 95
  • 2
  • 16
1
vote
3 answers

rtk query without a useEffect

With RTK query, do we have to use an effect to run a query on mount? React Query runs the query on mount without an effect, so wondered if there was similar behaviour? const Component = ({ id }) => { const [postCheckApplication, { data }] =…
user21175044
1
vote
0 answers

RTK query how to reset the params of the API when I invalidate during mutation

I am using RTK query in my react-native app, and I have a List of Home Posts and List of user posts and each has a skip param that is increment onEndReached I have a mutation fn deletePost that when trigger I invalidate both Lists. My problem is the…
warCommander
  • 392
  • 4
  • 19
1
vote
2 answers

send form data with rtk query

I wanna send an image with form data to the nest js server with RTK query but the file didn't send. the code are: uploadImage: builder.mutation({ query: (imageFile) => { var bodyFormData = new FormData(); …
Mehrad Farahnak
  • 1,033
  • 1
  • 9
  • 18
1
vote
1 answer

Does RTK Query compare the newly re-fetched data with the cached one to determine if there was a change?

NOTE: I'm not trying to call the query hook in another component which should return cached data if the same arguments were passed to the hook avoiding a new request to be made, my issue is when forcing a refetch. I'm working on a React Native…
abdou-tech
  • 687
  • 1
  • 8
  • 16
1
vote
0 answers

MSW Expect API Error with testing library fail assertion

I'm trying to test a failure on my API call with MSW, testing library and RTK Query. More on the context: I'm testing a hook and I'm calling a function and expect an API fail to assert that an error callback is call. This is the code, the test call…
1
vote
2 answers

React warning maximum update depth exceeded when update state inside useEffect

I am trying to update my state Variable which is an Object with boolean variables inside it, I am updating my state inside useEffect once the data (an api call response which I am fetching based on button click) is available. This data is then used…
1
vote
2 answers

Cannot read properties of undefined (reading 'invalidatesTags')

I'm trying to register on a React app using redux toolkit RTK I got this error : TypeError: Cannot read properties of undefined (reading 'invalidatesTags') at calculateProvidedByThunk (buildThunks.ts:629:1) at handler…
1
vote
1 answer

How to use RTCM data to achieve RTK?

I'm using this example from the Sparkfun Arduino Library /* Use ESP32 WiFi to get RTCM data from RTK2Go (caster) as a Client By: SparkFun Electronics / Nathan Seidle Date: November 18th, 2021 License: MIT. See license file for more…
1
vote
0 answers

How to invalidate previous page cache key on pagination in RTK query

I completed inflating the pagination engine for react native flat list with the RTK query. API pagination param is {offset: number, pageSize: number}. For example, I fetched with "offset:100, pageSize:10", then current fetch API is cache key is…
L.Benrong
  • 81
  • 1
  • 1
  • 4
1
vote
1 answer

I'm not sure how to use RTK without a desktop app

I'm using a ZED-F9P. Below is the Python script I've made for printing the Latitude and Longitude without correction data, but now I'd like to try and get more accurate with RTK. I've got familiar with desktop applications for applying RTCM like…
1
vote
1 answer

How to throw argument in RTK Query (queryFn)

I have queryFn query in RTK, and I need to get some data from firebase DB by element ID. But when I give this arg to queryFn like in example below, I got undefined. and I'm calling it like this:
whicencer
  • 13
  • 2
1
vote
1 answer

RTK Query and Mutation sequentially

I have a situation using rtk about how to use the mutations and queries sequentially. In my use case, in a route like /status/:id/:version, I need to create a job based on Id and version and then monitor the progress of creation (takes around 30…
ashil
  • 151
  • 1
  • 7