←back to thread

178 points taddgiles | 1 comments | | HN request time: 0.201s | source
Show context
recroad ◴[] No.45310580[source]
Elixir is fantastic. Liveview is a huge productivity multiplier - lot of boilerplate disappears.
replies(1): >>45311153 #
andrewflnr ◴[] No.45311153[source]
LiveView is fun, but my problem is that in practice I often want local-first state. Is there a good way to do that with LiveView, maybe a clean way to write the little javascript snippets so they work with local state?
replies(4): >>45311296 #>>45311461 #>>45312757 #>>45312810 #
1. ipnon ◴[] No.45311296[source]
LiveView already has local first state. The magic in LiveView is how it uses WebSocket connections to the client to keep the client state in sync with the server state. This is why you just need to update the socket and the rest just works.

If you want to have some state that only exists on the server, then you simply don’t assign that data to the socket.