defmodule ChronoscopeWeb.IndexLive do use ChronoscopeWeb, :live_view alias Chronoscope.NTS alias Chronoscope.NTS.KeyEstablishmentResponse @topic "nts-servers" def mount(_params, _session, socket) do ChronoscopeWeb.Endpoint.subscribe(@topic) {:ok, assign(socket, %{servers: NTS.list()})} end def handle_info(%{topic: @topic}, socket) do {:noreply, assign(socket, %{servers: NTS.list()})} end end