Getting current LiveView assign values

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.

Isn’t that what you just did? :assigns is part of the socket.

You could also use update instead of assign, but it would still accomplish the same thing:

  def handle_info(%{event: "added_game", payload: new_game}, socket) do
    {:noreply, update(socket, :rooms, fn rooms -> [new_game | rooms] end)}
  end