The Product Index (Part-II)
Let's learn how state management is done using mount/render in Phoenix LiveView.
We'll cover the following
Now that we know what will happen after the route is matched, let’s trace through our code, line by line.
How to establish product index state
The job of the ProductLive.Index
LiveView is to manage all actions that deal with lists of products. Regardless of the URL pattern, we match to get there, each path takes us first to the mount/3
function as explained in pento/lib/pento_web/live/product_live/index.ex
like this:
Get hands-on with 1400+ tech skills courses.