Raxol.LiveView.TEALive (Raxol v2.3.0)

View Source

A Phoenix LiveView that hosts a TEA (The Elm Architecture) application.

This allows any Raxol TEA app to run in a browser with the same init/1, update/2, and view/1 callbacks that work in the terminal.

Usage

In your Phoenix router:

live "/counter", Raxol.LiveView.TEALive,
  session: %{"app_module" => "Elixir.CounterExample"}

Or create a dedicated LiveView:

defmodule MyAppWeb.CounterLive do
  use Phoenix.LiveView

  def mount(params, session, socket) do
    Raxol.LiveView.TEALive.mount(params, session, socket,
      app_module: CounterExample
    )
  end

  # Delegate remaining callbacks...
end

Summary

Functions

mount(params, session, socket, opts)