Is there a documented/valid way to access the current values of a LiveView assigns. I managed to get the current value of LiveView assigns but it seems pretty hacky.
def handle_info(%{event: "added_game", payload: new_game}, socket) do
updated_game_list = [new_game | socket.assigns[:rooms]]
{:noreply, assign(socket, rooms: updated_game_list)}
end
I want to access the current value of rooms
in the assigns so I can append the message from Endpoint.broadcast
function.