defmodule LivebookWeb.AppSessionLive.CellOutputsComponent do use LivebookWeb, :live_component @impl true def mount(socket) do {:ok, stream(socket, :outputs, [])} end @impl true def update(assigns, socket) do socket = assign(socket, assigns) stream_items = for {idx, output} <- Enum.reverse(assigns.cell_view.outputs) do %{id: Integer.to_string(idx), idx: idx, output: output} end socket = stream(socket, :outputs, stream_items) {:ok, socket} end @impl true def render(assigns) do ~H"""