Closed gfortaine closed 3 years ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit bc75d642539cf38e9d9c360f9d84827911080a1f:
Sandbox | Source |
---|---|
React | Configuration |
React Typescript | Configuration |
rtk-query-demo | Configuration |
svelte-app-rtk-simplequery-demo | Configuration |
I'll take a look tomorrow. It seems reasonable, but I want to check if we don't have other options that lead the the same pitfall. You have seen that you can use the codesandbox build above meanwhile?
OK, looking forward to your review tomorrow 👌By the way, many thanks for the codesandbox tip, I hadn’t seen it 👍
Unfortunately, there's a bunch of other options with the same problem. I've opened #156 to try and find a more broad solution. Can you take a look please?
Solved by #156
Addresses points brought up in https://github.com/rtk-incubator/rtk-query/issues/154
We have a use case where we need to consume the headers of the response. It looks like that we could handle this case through
responseHandler
by returning the raw Response :(response) => response
. However, it seems that Redux Toolkit complains whenresponseHandler
is a function (because it is not serializable). Thus, it appears that a suitable approach would be to simply add'raw'
as a potentialresponseHandler
type, then to handle the raw Response withtransformResponse
(see corresponding tests).