-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathlive_debugger_web.ex
More file actions
58 lines (44 loc) · 1.29 KB
/
live_debugger_web.ex
File metadata and controls
58 lines (44 loc) · 1.29 KB
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
defmodule LiveDebuggerWeb do
@moduledoc false
def live_view do
quote do
use Phoenix.LiveView,
layout: {LiveDebuggerWeb.Layout, :app}
on_mount({LiveDebuggerWeb.Hooks.Flash, :add_hook})
on_mount({LiveDebuggerWeb.Hooks.IframeCheck, :add_hook})
on_mount({LiveDebuggerWeb.Hooks.URL, :add_hook})
import Phoenix.HTML
import LiveDebuggerWeb.Helpers
import LiveDebuggerWeb.Components
import LiveDebuggerWeb.Hooks.Flash, only: [push_flash: 2, push_flash: 3]
end
end
def live_component do
quote do
use Phoenix.LiveComponent
import Phoenix.HTML
import LiveDebuggerWeb.Helpers
import LiveDebuggerWeb.Components
import LiveDebuggerWeb.Hooks.Flash, only: [push_flash: 2, push_flash: 3]
end
end
def component do
quote do
use Phoenix.Component
import Phoenix.HTML
import LiveDebuggerWeb.Helpers
import LiveDebuggerWeb.Components
end
end
defmacro __using__(which) when is_atom(which) do
apply(__MODULE__, which, [])
end
end
defmodule LiveDebuggerWeb.Helpers do
@moduledoc false
def empty_map(_), do: %{}
def ok(socket), do: {:ok, socket}
def noreply(socket), do: {:noreply, socket}
def cont(socket), do: {:cont, socket}
def halt(socket), do: {:halt, socket}
end