Allow GrpcWebFetchTransport to receive a fetch function
Hey there first, thanks for this project!
I'd like to ask for the ability to construct GrpcWebFetchTransport with a fetch function.
The use case here would be when using svelte for example where the load (https://kit.svelte.dev/docs/load#making-fetch-requests) function receives an implementation, and it is safer to use it on SSR and on browser.
Is it something viable or, should I have been using another option for that?
Thanks in advance!
Even if there were an option to allow you to pass in your own fetch function I don't think it would help you with your svelte/SSR goal. In your link it says:
During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the
textandjsonmethods of theResponseobject.
But the GrpcWebFetchTransport uses neither of those methods. Instead it reads from the Response.body which is a ReadableStream.