On LiveView pages usually there’ll be code similar to this:
defmodule MyAppWeb.MyPageLive.Index do
# ..........
defp apply_action(socket, :edit, %{"id" => id}) do
items = Repo.get!(MyData, id)
# ........
socket
|> assign(:page_title, "Edit MyData")
|> assign(:my_data, items)
end
What assign()
function is this? Where is it imported from precisely - from what module?
For there’re multiple modules in “deps/” that all have to do with Phoenix or LiveView and that all contain the definition ofassing(...)
in them.