messense / leptos_sse

Leptos server signals synced through Server-Sent-Events (SSE)
Other
29 stars 9 forks source link

Using `ServerSentEvents::channel` doesn't work #5

Open smessmer opened 1 year ago

smessmer commented 1 year ago

I just switched from ServerSentEvents::new to ServerSentEvents::channel, but now it panics on the client saying the patch can't be applied. Looking at browser network logs, the very first message sent by the server over the wire is already a patch expecting previous data. And the initial message setting up the data seems to be missing.

smessmer commented 1 year ago

Nvm, my mistake. I built the channel based on some type T while the signal expected Option<T>. That broke it. Wondering if there's any type checking the library could do to detect this and show a better error.