Add elixir snippets

This commit is contained in:
Austen Adler 2020-07-09 00:57:30 -04:00
parent 6df680fc08
commit a62252137c
3 changed files with 21 additions and 0 deletions

3
snippets/elixir/hev Normal file
View File

@ -0,0 +1,3 @@
def handle_event("{event}", %{}, socket) do
{:noreply, assign(socket, {assigns})}
end

15
snippets/elixir/liveview Normal file
View File

@ -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

3
snippets/elixir/mod Normal file
View File

@ -0,0 +1,3 @@
defmodule {Module} do
{body}
end