You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using SvelteKit in conjunction with elysia and eden. I use the SvelteKit load function to run SSR queries against my elysia api which uses the SvelteKit integration as described in the docs.
The load functions use a special fetch function to fetch data augmented with e.g. user authorization header as described here. So for my eden treaty client to use that special fetcher I made a slim wrapper which simplifies this:
So on every call my wrapper instantiates a new treaty instance. Is there a way to avoid this overhead? Is this even a relevant overhead? Thanks for any response! :D
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using SvelteKit in conjunction with elysia and eden. I use the SvelteKit load function to run SSR queries against my elysia api which uses the SvelteKit integration as described in the docs.
The load functions use a special
fetch
function to fetch data augmented with e.g. user authorization header as described here. So for my eden treaty client to use that special fetcher I made a slim wrapper which simplifies this:Usage in my load functions (+page.ts) may look like this:
So on every call my wrapper instantiates a new treaty instance. Is there a way to avoid this overhead? Is this even a relevant overhead? Thanks for any response! :D
Beta Was this translation helpful? Give feedback.
All reactions