Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lib/phoenix_component/declarative.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ defmodule Phoenix.Component.Declarative do

# slot with attributes
_ ->
slot_attr_defs = Enum.into(attrs, %{}, &{&1.name, &1})
slot_attr_defs = Map.new(attrs, &{&1.name, &1})
required_attrs = for {attr_name, %{required: true}} <- slot_attr_defs, do: attr_name

for %{attrs: slot_attrs, line: slot_line, root: false} <- slot_values,
Expand Down
8 changes: 4 additions & 4 deletions lib/phoenix_live_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,7 @@ defmodule Phoenix.LiveView do
def send_update(pid \\ self(), module_or_cid, assigns)

def send_update(pid, module, assigns) when is_atom(module) and is_pid(pid) do
assigns = Enum.into(assigns, %{})
assigns = Map.new(assigns)

id =
assigns[:id] ||
Expand All @@ -1513,7 +1513,7 @@ defmodule Phoenix.LiveView do
end

def send_update(pid, %Phoenix.LiveComponent.CID{} = cid, assigns) when is_pid(pid) do
assigns = Enum.into(assigns, %{})
assigns = Map.new(assigns)

Phoenix.LiveView.Channel.send_update(pid, cid, assigns)
end
Expand Down Expand Up @@ -1547,14 +1547,14 @@ defmodule Phoenix.LiveView do

def send_update_after(pid, %Phoenix.LiveComponent.CID{} = cid, assigns, time_in_milliseconds)
when is_integer(time_in_milliseconds) and is_pid(pid) do
assigns = Enum.into(assigns, %{})
assigns = Map.new(assigns)

Phoenix.LiveView.Channel.send_update_after(pid, cid, assigns, time_in_milliseconds)
end

def send_update_after(pid, module, assigns, time_in_milliseconds)
when is_atom(module) and is_integer(time_in_milliseconds) and is_pid(pid) do
assigns = Enum.into(assigns, %{})
assigns = Map.new(assigns)

id =
assigns[:id] ||
Expand Down
4 changes: 2 additions & 2 deletions lib/phoenix_live_view/channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ defmodule Phoenix.LiveView.Channel do
end

defp delete_components(state, cids) do
upload_cids = Enum.into(state.upload_names, MapSet.new(), fn {_name, {_ref, cid}} -> cid end)
upload_cids = MapSet.new(state.upload_names, fn {_name, {_ref, cid}} -> cid end)

Enum.flat_map_reduce(cids, state, fn cid, acc ->
{deleted_cids, new_components} = Diff.delete_component(cid, acc.components)
Expand Down Expand Up @@ -1701,7 +1701,7 @@ defmodule Phoenix.LiveView.Channel do
defp socket_asyncs(private, cid) do
case private do
%{live_async: ref_pids} ->
Enum.into(ref_pids, %{}, fn {key, {ref, pid, kind}} -> {pid, {key, ref, cid, kind}} end)
Map.new(ref_pids, fn {key, {ref, pid, kind}} -> {pid, {key, ref, cid, kind}} end)

%{} ->
%{}
Expand Down
Loading