Skip to content

Instantly share code, notes, and snippets.

@50kudos
Created May 15, 2019 15:29
Show Gist options
  • Save 50kudos/d855575c93d241c5c8c09f061ae4ed42 to your computer and use it in GitHub Desktop.
Save 50kudos/d855575c93d241c5c8c09f061ae4ed42 to your computer and use it in GitHub Desktop.
defmodule FoldlaWeb.DataLive do
use Phoenix.LiveView
def render(assigns) do
FoldlaWeb.DataView.render("edit.html", assigns)
end
def mount(_params, socket) do
{:ok, assign(socket, :thing, 0)}
end
def handle_event("inc", _value, socket) do
{:noreply, assign(socket, :thing, socket.assigns.thing + 1)}
end
end
<span phx-ignore>Here is the thing: <%= @thing %></span>
@50kudos
Copy link
Author

50kudos commented May 15, 2019

phoenix: "~> 1.4"
phoenix_live_view: github: "phoenixframework/phoenix_live_view"
View layout: default

@50kudos
Copy link
Author

50kudos commented May 15, 2019

This!
liveview_ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment