Starlord
Starlord2mo ago

i love reactive update via websocket

i love reactive update via websocket from convex but i am missing one part. that mutation code can be shared with withOptimisticUpdate. so i dont need to write basically same code on server and client. to find the way where schema tables and localstore can be same and execute same code
3 Replies
erquhart
erquhart2mo ago
That's 100% the dream, and something the Convex team has talked on the topic here, but it's extremely non-trivial to do well. Optimistic updates are not attempting to be that. The way to think about optimistic updates is as a synchronous state shim for specific UX cases. Don't try to make everything update optimistically, just things that truly need it.
Starlord
StarlordOP2mo ago
but optimistic updates are great to have no delay on actions expecially if its gamelike experience
erquhart
erquhart2mo ago
For sure, totally agree. Bit of a tradeoff. If it's a game you probably need more things to be synchronously/optimistically updated, but maybe not absolutely everything.

Did you find this page helpful?