diff --git a/snippets/elixir/hev b/snippets/elixir/hev new file mode 100644 index 0000000..bd69cea --- /dev/null +++ b/snippets/elixir/hev @@ -0,0 +1,3 @@ +def handle_event("{event}", %{}, socket) do + {:noreply, assign(socket, {assigns})} +end diff --git a/snippets/elixir/liveview b/snippets/elixir/liveview new file mode 100644 index 0000000..178f6cb --- /dev/null +++ b/snippets/elixir/liveview @@ -0,0 +1,15 @@ +defmodule {Package}.{Name}Live do + use {Package} + @impl true + + def mount(_params, _session, socket) do + {:ok, assign(socket)} + end + + def render(assigns) do + ~L""" + """ + end + + {body} +end diff --git a/snippets/elixir/mod b/snippets/elixir/mod new file mode 100644 index 0000000..bd67226 --- /dev/null +++ b/snippets/elixir/mod @@ -0,0 +1,3 @@ +defmodule {Module} do + {body} +end