Phoenix LiveView Snippets
Phoenix LiveView snippets for Sublime Text
Details
Installs
- Total 251
- Win 114
- Mac 85
- Linux 52
| Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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} endhi->def handle_info(${1:message}, socket) do socket = assign(socket, ${2:key}: ${3:value}) {:noreply, socket} endhp->def handle_params(params, _url, socket) do {:noreply, socket} endlv->defmodule LiveViewStudioWeb.${1}Live do use LiveViewStudioWeb, :live_view endmount->def mount(_params, _session, socket) do socket = assign(socket, ${1:key}: ${2:value}) {:ok, socket} endrend->def render(assigns) do ~L""" ${0} """ endlt->~L""" ${0} """test->test "${1:description}", %{conn: conn} do {:ok, view, _html} = live(conn, "${2:path}") ${0} endlvtest->defmodule LiveViewStudioWeb.${1}Test do use LiveViewStudioWeb.ConnCase, async: true import Phoenix.LiveViewTest ${0} end
Contributing
Pull requests welcome.