For the past two to three weeks I’ve been working with LiveView in a side-project and one thing that I’m noticing so far is that my LiveView code is getting “bloated” very quickly.
Since I’m working with one LiveView as the single source of truth and a lot of LiveComponents which are constantly pushing state updates, I’m handling all of this information flow in a single place - the LiveView.
That being said, I was wondering what strategies are being used by the community to improve this…
One of the things that I was thinking is: creating a
live/handlers folder and place modules that will concentrate the logic that manipulates the information there; letting the LiveView code exclusively to receive the events and call those modules, akin to the “thin controllers & fat model” approach. Has anyone tried something like this?