This commit is contained in:
Ibrahim committed 2024-09-27 15:44:01 -04:00
1 parent ea7a3e07cb
commit 579c0c9d01
5 files changed
+47 -249

No files matched your search

@@ -80,6 +80,9 @@ function _broadcastEvent(eventName, callbackProps) {
const hasListeners = Object.keys(this.listeners).length > 0;
const hasCallbacks = Array.isArray(this.listeners[eventName]);
const event = new CustomEvent(eventName, { detail: callbackProps });
document.body.dispatchEvent(event);
if (hasListeners && hasCallbacks) {
this.listeners[eventName].forEach(listener => {
listener.callback(callbackProps);