| imagine an SPA for a basic CRUD system. there's a list view and details view with a delete button that returns you to the list. in liveview server renders me the list view, i click details, server renders me details view, i click delete button, server renders me the list view. if there's big latency/connection error/etc between clicking delete and getting back the rendered list - user just has to wait. in spa i could optimistically assume that delete worked and render the list that i already have cached without the deleted item, allowing user to continue working immediately and if there was a disconnect/error - i could retry that delete in the background without bothering user, only prompting them after some number of retries. don't see how could i implement this workflow in liveview. |
pushEvent, pushEventTo (from client to server) [0]
push_event (from server to client) [1]
[0] https://hexdocs.pm/phoenix_live_view/js-interop.html#client-...
[1] https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#p...