Organizing liveviews - when to use live_action, and when to have separate liveview?

dberg
Fri, 03 Mar 2023 09:29:36 +0000
Questions / Help

I’ve seen a few posts discussing how to organize components, but what is best practice when it comes to organizing the liveviews themselves?

How much should I put in each liveview (and use @live_action) in the view to “toggle” whats shown, and when to break it out in a new liveview? Are there any example liveview projects that are more complex than say a todo-app - i.e something handling multiple nested “resources”?

For instance, it is not immediately clear to me when looking at the router (at 3:10) in Phoenix LiveView Crash Course - YouTube what guiding principles decide what ends up in (for instance) MemberSubscriptionLive.Index vs MemberSubscriptionLive.Edit.

3 posts - 2 participants