Replies: 1 comment 4 replies
-
in your other slice, you can respond to the original endpoint fulfilled action, which will have the response instance attached. const slice = createSlice({
...config,
extraReducers(builder) {
builder.addMatcher(api.endpoints.getPost.matchFulfilled, (state, action) => {
const { response } = action.meta.baseQueryMeta
try {
const json = response.json();
} catch {}
})
}
}) alternatively if you wanted to do this in a place where you have access to dispatch, you could use a listener. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a query where the fetch response is transformed using
transformResponse
.I also want to search the original (not the transformed) response for some data to add to another Redux slice (meaning I need the dispatch API).
Since
dispatch
is not available fromtransformResponse
, is there another place where I have access to the original response + dispatch?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions