Replies: 1 comment 8 replies
-
If you have a realtime connection, you can likely go without Pinia Colada. That being said, it should be possible to use a realtime connection and benefit from optimistic updates. I haven't tried it myself but if I had to implement it, I would create a custom |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my long journey into learning Pinia I've got to admit that Pinia-Colada did make things much easier, but I'm wondering about a use-case that involves Server-Sent Events (in particular in a Nuxt application using Nitro's SSEs), and I'm wondering if I'm going completely offtrack...
My main curiosity point on this is that I always want the freshest state for a particular client's ref, while also using the already available API routes to mutate those states. This means that server-to-client is going to reuse the existing connection, while each client-to-server operation will be a discrete connection (as such, WebSockets will be for a different discussion).
My first idea would be to use
useEventSource
from Vueuse, butuseQuery
'squery
param requires an async function, just like an initialization step 🤔Beta Was this translation helpful? Give feedback.
All reactions