LiveView's Async Assigns

Notes

LiveView 0.20 ships with a new assign_async/3 function that makes adding an async assign on mount a breeze!

The assign_async/3 function returns a %AsyncResult{} struct that has an :ok?, :loading, :failed, and :result fields to help us display loading screens as well as failed and successful cases.

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

Want the latest Elixir Streams in your inbox?

    No spam. Unsubscribe any time.