Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

detect livewire is loading in javascript

window.livewireLoading = false;

document.addEventListener("DOMContentLoaded", () => {
    Livewire.hook('message.sent', (message, component) => {
        livewireLoading = true;
    })

    Livewire.hook('message.processed', (message, component) => {
        livewireLoading = false;
    })
});
Source by devdojo.com #
 
PREVIOUS NEXT
Tagged: #detect #livewire #loading #javascript
ADD COMMENT
Topic
Name
9+1 =