@alsaraha this question is a bit light on details but you’re probably going to need to read up on Hooks, especially the need to use phx-update="ignore" on elements that are going to be modified by some of your JS.
Your reply is helpful though not the answer. I can listen to “phx:update” event and reinitialize the library, but still I am looking for event like “phx:mount”
You might have more luck if you work with the framework. If you’re changing the DOM outside of liveview, you need to tell liveview to ignore that part with phx-update="ignore" (not what you’re talking about with listening to events).
You might have some success by leaving liveSocket.connect() alone, getting rid of that event listener and creating a hook for Masonry (based on the event listener).