From 20b7df9d0c80be54561e36f04935763d5695556c Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 28 Jul 2020 00:12:58 -0400 Subject: [PATCH] Add snippets --- snippets/elixir/he | 4 ++++ snippets/elixir/hi | 4 ++++ snippets/elixir/hp | 4 ++++ snippets/elixir/liveview | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 snippets/elixir/he create mode 100644 snippets/elixir/hi create mode 100644 snippets/elixir/hp diff --git a/snippets/elixir/he b/snippets/elixir/he new file mode 100644 index 0000000..824ffbc --- /dev/null +++ b/snippets/elixir/he @@ -0,0 +1,4 @@ +def handle_event("{event}", {map}, socket) do + {body} + {:noreply, socket} +end diff --git a/snippets/elixir/hi b/snippets/elixir/hi new file mode 100644 index 0000000..6f443f8 --- /dev/null +++ b/snippets/elixir/hi @@ -0,0 +1,4 @@ +def handle_info("{info}", {map}, socket) do + {body} + {:noreply, socket} +end diff --git a/snippets/elixir/hp b/snippets/elixir/hp new file mode 100644 index 0000000..1f359ad --- /dev/null +++ b/snippets/elixir/hp @@ -0,0 +1,4 @@ +def handle_params("{param}", {map}, socket) do + {body} + {:noreply, socket} +end diff --git a/snippets/elixir/liveview b/snippets/elixir/liveview index 178f6cb..be29027 100644 --- a/snippets/elixir/liveview +++ b/snippets/elixir/liveview @@ -1,5 +1,5 @@ defmodule {Package}.{Name}Live do - use {Package} + use {Package}, :live_view @impl true def mount(_params, _session, socket) do