axum-live-view
axum-live-view copied to clipboard
Should `LiveView::{mount, update}` be async?
While update
is being called no other events will be processed and insert put into a queue. So if you do slow async stuff (like making web requests) your view will freeze while its running. The solution is using Updated::spawn
to spawn a future that returns a message which gets passed back into update
.
I think we should consider making update
not-async since its probably what you want anyway. The same goes for mount
. While that is running the view wont update.