-
I have open and closed post queries with a socket.io stream on each, as well as a query to fetch the users open and closed posts with the same onCacheEntryAdded setup. Data coming in uses an entityAdapter, so the data object has ids[] and entities{}. When a steam comes in for the user, I am using
I need a way to check that draft object for the existing ids and prevent any ids not matching to be skipped. When I log out the draft object, it's not recognizable. Looking at the upsert, add, and set functions, none of them will opt out from adding a post, if that post id doesn't exist. This is the logged out draft object I used this setup https://redux-toolkit.js.org/rtk-query/usage/streaming-updates#websocket-chat-api-with-a-transformed-response-shape Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can access that normally, it just logs weird because it is an Generally: if you just want to update, use |
Beta Was this translation helpful? Give feedback.
You can access that normally, it just logs weird because it is an
immer
proxy object.See https://redux-toolkit.js.org/api/createReducer#logging-draft-state-values
Generally: if you just want to update, use
update
, notupsert
. That way no new entries will be created.