Hi.
I have a component with a script portion (pushed to scripts
stack) in which I want to do something after the DOM is updated. I have something like this:
document.addEventListener("livewire:load", function(event) {
window.livewire.afterDomUpdate(() => {
doSomething();
doEvenMoreStuff();
});
});
The problem is this event is getting caught by other Livewire components in the page and I want to apply it only for the one in which it is defined.
Is there a way to compare something in the event
parameter with @this
in order to find out if it is the right component?