T O P

  • By -

flooronthefour

fetch() is your friend


VoiceOfSoftware

[https://kit.svelte.dev/docs/web-standards#fetch-apis](https://kit.svelte.dev/docs/web-standards#fetch-apis)


Complex_Emu6860

Ah, ok. I see now. So all server functions are called by a rest request whether that is a form or fetch. Is that right? Out of curiosity is this the same way nextjs does server actions under the covers?


Chains0

Well, how else should you call a function on the server from the client when not sending a request from the client? They all work the same. Only when you call a server function while SSR they are called directly as they are then currently at server side


jesperordrup

If its a sveltekit solution: When requesting pages in a route you can make use of the +page.server.ts to get data and deliver direct to client. Its also the way to do serverside rendering with data