Skip to content

devmuroid/liveview_playground

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Your first LiveView!

The easiest way to have your LiveView running without boilerplate

Installation

Create a file named main.exs:

Mix.install([
  {:liveview_playground, "~> 0.1.6"}
])

defmodule PageLive do
  use LiveviewPlaygroundWeb, :live_view

  def mount(_params, _session, socket) do
    {:ok, assign(socket, :name, "World")}
  end

  def render(assigns) do
    ~H"""
    Hello <%= @name %>
    """
  end
end

LiveviewPlayground.start()

Then run elixir main.exs. Congratulations! You have LiveView running at http://localhost:4000

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%