-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[typescript-fetch] Allow fetch to be passed in configuration #2642
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
Never mind, I see that 4.0 is a major refactor that has middleware that likely does exactly this. Still trying to read through it and then try it to verify, but guidance appreciated. |
This was referenced Oct 1, 2023
This was referenced Nov 28, 2023
This was referenced May 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When generating typescript-fetch code, I would like to be able to pass in a single argument to the various API constructors/methods that covered all the options, INCLUDING the fetch function. Our use case is to automatically inject various metrics and headers to outgoing requests and incoming responses, and they are "per instance." So overriding fetch is great, BUT, it means if I want to create a client with these overrides, I need to do:
That function takes three arguments now - config, fetch, and basePath. It already allows basePath to be passed into the config, so I'm suggesting that fetch is also allowed to be passed into the config. PR forthcoming if I can grok it.
The text was updated successfully, but these errors were encountered: