Add elixir snippets
This commit is contained in:
parent
6df680fc08
commit
a62252137c
3
snippets/elixir/hev
Normal file
3
snippets/elixir/hev
Normal file
@ -0,0 +1,3 @@
|
||||
def handle_event("{event}", %{}, socket) do
|
||||
{:noreply, assign(socket, {assigns})}
|
||||
end
|
15
snippets/elixir/liveview
Normal file
15
snippets/elixir/liveview
Normal 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
3
snippets/elixir/mod
Normal file
@ -0,0 +1,3 @@
|
||||
defmodule {Module} do
|
||||
{body}
|
||||
end
|
Loading…
Reference in New Issue
Block a user