examples icon indicating copy to clipboard operation
examples copied to clipboard

SvelteKit SSE example

Open karimfromjordan opened this issue 2 years ago • 2 comments

I'm not sure how complex an SSE (Server Sent Events) example should be. But since the actual SSE part on the backend is super simple we could combine it with a toast component to make it more "real world". SSE and websockets are also great to demonstrate custom stores.

  • use a +server.js route to return a ReadableStream response for the SSE connection
  • use a custom store to listen for any incoming messages/events
  • include a minimal but complete toast component to display the messages

karimfromjordan avatar Feb 20 '23 16:02 karimfromjordan

What's SSE?

braebo avatar Feb 20 '23 16:02 braebo

I'm sorry. I should have spelled it out: Server Sent Events

karimfromjordan avatar Feb 20 '23 16:02 karimfromjordan