You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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' }
The text was updated successfully, but these errors were encountered:
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' }
The text was updated successfully, but these errors were encountered: