defmodule WildWeb.Index do
  use WildWeb, :live_view

  @impl true
  def mount(_params, _session, socket) do
    # {:ok, stream(socket, :book_reads, BookReads.list_book_reads())}
    {:ok, socket}
  end

  # @impl true
  # def handle_params(params, _url, socket) do
  #   {:noreply, apply_action(socket, socket.assigns.live_action, params)}
  # end
  #
  # defp apply_action(socket, :edit, %{"id" => id}) do
  #   socket
  #   |> assign(:page_title, "Edit Book read")
  #   |> assign(:book_read, BookReads.get_book_read!(id))
  # end
  #
  # defp apply_action(socket, :new, _params) do
  #   socket
  #   |> assign(:page_title, "New Book read")
  #   |> assign(:book_read, %BookRead{})
  # end
  #
  # defp apply_action(socket, :index, _params) do
  #   socket
  #   |> assign(:page_title, "Listing Book reads")
  #   |> assign(:book_read, nil)
  # end
  #
  # @impl true
  # def handle_info({WildWeb.BookReadLive.FormComponent, {:saved, book_read}}, socket) do
  #   {:noreply, stream_insert(socket, :book_reads, book_read)}
  # end
  #
  # @impl true
  # def handle_event("delete", %{"id" => id}, socket) do
  #   book_read = BookReads.get_book_read!(id)
  #   {:ok, _} = BookReads.delete_book_read(book_read)
  #
  #   {:noreply, stream_delete(socket, :book_reads, book_read)}
  # end
end
