-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlive_debugger_web.ex
60 lines (47 loc) · 1.01 KB
/
live_debugger_web.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
defmodule LiveDebuggerWeb do
@moduledoc false
def live_view do
quote do
use Phoenix.LiveView,
layout: {LiveDebugger.Layout, :app}
import Phoenix.HTML
import LiveDebuggerWeb.Helpers
unquote(petal_components())
end
end
def live_component do
quote do
use Phoenix.LiveComponent
import Phoenix.HTML
import LiveDebuggerWeb.Helpers
unquote(petal_components())
end
end
def component do
quote do
use Phoenix.Component
import Phoenix.HTML
import LiveDebuggerWeb.Helpers
unquote(petal_components())
end
end
defp petal_components do
quote do
import PetalComponents.{
Typography,
Card,
Icon,
Container,
Loading
}
end
end
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
end
defmodule LiveDebuggerWeb.Helpers do
@moduledoc false
def ok(socket), do: {:ok, socket}
def noreply(socket), do: {:noreply, socket}
end