Skip to content

Commit

Permalink
Update toaster.js
Browse files Browse the repository at this point in the history
Dispatch events on document node
  • Loading branch information
mabdullahsari committed Sep 4, 2023
1 parent 5b60f74 commit adf16f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/js/toaster.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const event = (message, type) => {
dispatchEvent(new CustomEvent('toaster:received', { detail: { message, type }}));
document.dispatchEvent(new CustomEvent('toaster:received', { detail: { message, type }}));
};

const error = message => event(message, 'error');
Expand Down

0 comments on commit adf16f4

Please sign in to comment.