Closed
Description
I'm trying to find a way to not overwrite the previous responses state, but instead merge it with the new response for the same end point. This would prevent unnecessary load on the server since the data has already been requested on the first request. I also don't see a way to getState before the second request completes. Thanks in advance.
Example
First response.
{ text: 'This is the first response' }
Second response overwrites first response.
{ text2: 'This is the second response' }
What I would like with second response. Take the first response and merge it with the second response using the spread operator or if there is built-in functionality with RTK Query.
{ text: 'This is first response', text2: 'This is the second response' }
Metadata
Metadata
Assignees
Labels
No labels