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

Would love to be able to pass `fetch` and/or `autoParse` per request #35

Open matthewrobb opened 1 year ago

matthewrobb commented 1 year ago

I am finding scenarios where I generally want auto-parsing but sometimes I need access to the response object. I would prefer to just pass autoParse: false on those specific calls. Similarly, I am writing code that I want to work in both edge workers and the browser where I would like to be able to pass the fetch override from sveltekit in per request rather than having to create a whole fetcher every server-side call-site.

kwhitley commented 1 year ago

I'll take a look to see what it would take for this, but part of the challenge is that we basically treat the per-request options as a direct pass-through to fetch. Blending in our own would mean adding code to separate them back out!

Def not ruling it out though :)