I have this UC where I need to add/remove my own elements in JS on top of a LiveView rendered template.
For this purpose I use phx-update=“ignore” in the container element to which I add my JS controlled element.
I also add a listener to that element (since I cannot use phx-hook with it). And, naturally, I remove the listener when removing the element manually.
However, I don’t know how to remove the listener from my manually added element when LV removes its parent container element. Up until v0.15.2 there was the beforeDestroy callback, but not any more.