Closed schadenn 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 1d0d9dd52e137afac2e2d5c4dc26a210ee01b567:
Sandbox | Source |
---|---|
React | Configuration |
React Typescript | Configuration |
rtk-query-demo | Configuration |
svelte-app-rtk-simplequery-demo | Configuration |
@schadenn Thanks for the PR! Do you mind if I add a quick test on top of this or would you be interested in doing that?
I'll add it.
I'll add it.
Thank you! 🥇
Done :)
I'm trying to use the
prepareHeaders
function to add anaccessToken
to my API requests. Unfortunately the function I'd have to use to get theaccessToken
in our setup is asynchronous.So my proposal would be: Make the
prepareHeaders
function support async functions. Since this is being called in an asynchronous function anyways there's not a lot to change and it'd save us a lot of overhead by not having to put theaccessToken
into state first and then get it from there.Hopefully it'll also help some other users :)