I am working with rtk query and I have 2 different sources of data:
- ongoing websocket connection that updates cache with updateCachedData whenever relevant notification is received,
- http requests to the api to get an existing data from db
The cached data is store inside of the api > queries > endpointname > data.
When I made a particular api call I want to update the cached data with that result. updateCachedData is not available for the query.mutation so I am not sure how this can be achieved.
Also, should I keep the copy of that cached data inside of the normal slice?
Thanks
I've tried researching the subject but its unclear. Some people state it's a good idea to keep the copy of that data inside of the normal slice and update it there but then this data will be there indefinitely.