kwhitley / itty-fetcher

An even simpler wrapper around native Fetch to strip boilerplate from your fetching code!
MIT License
99 stars 4 forks source link

Idea: transformRequest return Promise<FetchLike> #36

Closed tomlarkworthy closed 1 year ago

tomlarkworthy commented 1 year ago

transformRequest mutation would be more useful if asynchronous work could be done before sending the request. For example, aws4fetch could be used as a request interceptor and make form a nice pluggable s3 interface. Note signing requests use subtle.crypto and introduces async execution: https://github.com/mhart/aws4fetch#promiserequest-awssigninput-init, I can expect quite a few auth header attachments might want to be able to use subtle.crypto and thus an async capable transformRequest function seems a generally useful ask.

kwhitley commented 1 year ago

As simple as awaiting the function - going out in the next release!

kwhitley commented 1 year ago

Live in v0.9.x 🚀