Phoenix LiveView Snippets
Phoenix LiveView snippets for Sublime Text
Details
Installs
- Total 251
- Win 114
- Mac 85
- Linux 52
Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Phoenix LiveView snippets for Sublime Text
Taken from the Phoenix LiveView course from The Pragmatic Studio.
Installation
Using Package Control, bring up the command palette and install the package by name. Alternatively, clone this repo as a subfolder inside your ~/.config/sublime-text/Packages
folder.
Snippets included
Included:
checkbox
-><input type="checkbox" id="${1}" name="${2}" value="${3}"/>
econd
-><%= cond do %> <% $1 -> %> $2 <% true -> %> $3 <% end %>
data
-><datalist id="${1}"> ${0} </datalist>
eelse
-><% else %>
eend
->% end %>
hidden
-><input type="hidden" name="${1}" value="${2}" />
eif
-><%= if $1 do %> $2 <% end %>
eife
-><%= if $1 do %> $2 <% else %> $3 <% end %>
eifa
-><%= if $1, do: "{$1}" %>
input
-><input type="text" name="${1}" value="${2}" placeholder="${3}" />
et
-><%= $1 %>
eunless
->%= unless $1 do %> $2 <% end %>
efor
-><%= for ${1:item} <- @$1s do %> $2 <% end %>
efori
-><%= for ${1:item} <- @$1s do %> $2 <% end %>
lc
->defmodule LiveViewStudioWeb.${1}Component do use LiveViewStudioWeb, :live_component end]
he
->def handle_event(${1:event}, _, socket) do socket = assign(socket, ${2:key}: ${3:value}) {:noreply, socket} end
hi
->def handle_info(${1:message}, socket) do socket = assign(socket, ${2:key}: ${3:value}) {:noreply, socket} end
hp
->def handle_params(params, _url, socket) do {:noreply, socket} end
lv
->defmodule LiveViewStudioWeb.${1}Live do use LiveViewStudioWeb, :live_view end
mount
->def mount(_params, _session, socket) do socket = assign(socket, ${1:key}: ${2:value}) {:ok, socket} end
rend
->def render(assigns) do ~L""" ${0} """ end
lt
->~L""" ${0} """
test
->test "${1:description}", %{conn: conn} do {:ok, view, _html} = live(conn, "${2:path}") ${0} end
lvtest
->defmodule LiveViewStudioWeb.${1}Test do use LiveViewStudioWeb.ConnCase, async: true import Phoenix.LiveViewTest ${0} end
Contributing
Pull requests welcome.