Very first Phoenix Liveview project. Probably my understanding of the life cycle is “weak” at this stage so I hope theses questions make sense.
All my pages are liveviews. The only time is need to declare a mount function is for a live module when I need some internal state, with handlers.
I can put a nav link inside “templates/layout/root.html.heex”, and use @conn in the links:
<li><%= live_redirect "demo", to: Routes.live_path(@conn, DemoWeb.HomeLive) %></li>.
I can also put a nav link in the “templates/layout/live.html.heex” but have to use @socket in the links.
<li><%= live_redirect "home", to: Routes.live_path(@socket, DemoWeb.HomeLive) %></li>
Where does @conn come from for the “layout/root” case? And where does the @socket comes from as well for the “layout/live” case?






















