LiveView's start_async helper for arbitrary async operations

LiveView 0.20 ships with a new start_async/3 function that makes it so easy to perform arbitrary async operations!

We saw LiveView’s assign_async helper in a previous video, but sometimes we want an arbitrary async task. Ideally, we’d like to get the same process isolation and error handling that we get with assign_async.

Well that’s what start_async/3 is!

Define a task with start_async/3 and then handle the success and error cases with handle_async/3. LiveView will take care of the rest! 🤩

You can read more on the async operations section of the docs.

Want the latest Elixir Streams in your inbox?

    No spam. Unsubscribe any time.