Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/phoenix_live_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,8 @@ defmodule Phoenix.LiveView do
an `Phoenix.LiveView.AsyncResult` struct holding the status of the operation
and the result when the function completes.

The function must return either a map or a keyword list with the assigns
to merge into the socket.
The function must return either `{:ok, assigns}` or `{:error, reason}`,
where `assigns` is a map with the keys passed to `assign_async/3`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A keyword list should work

Suggested change
where `assigns` is a map with the keys passed to `assign_async/3`.
where `assigns` is a map or keyword list with the keys passed to `assign_async/3`.

Copy link
Copy Markdown
Contributor Author

@preciz preciz May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work when keyword list is used:

{:ok, %{} = assigns} ->

Also just tested it manually again.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I guess the list check here is unnecessary then:

{:ok, {:ok, assigns}} when is_map(assigns) or is_list(assigns) ->
- if it never worked, we can adjust the documentation indeed


The task is only started when the socket is connected.

Expand Down
Loading