Is there a way to get Livewire component name in livewire hook JS?

Viewed 116

I have a global loader in my livewire application, which shows loader on message.sent livewire js hook, and hide on message.processed hook which is working fine, but now i want when specific livewire component calls loader will remain hide.

enter image description here

1 Answers

I was looking for the same question, with component.fingerprint.name you can get the component name.

example:

Livewire.hook('message.sent', (message, component) => {
    console.log(component.fingerprint.name,component,message)
})
Related