axum-live-view icon indicating copy to clipboard operation
axum-live-view copied to clipboard

Should `LiveView::{mount, update}` be async?

Open davidpdrsn opened this issue 2 years ago • 0 comments

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.

davidpdrsn avatar Mar 18 '22 13:03 davidpdrsn