UNPKG

@mr-samani/event-bus

Version:

A lightweight JavaScript event bus for any framework with auto-global support

2 lines 499 B
var EventBus=(function(){'use strict';var a={events:{},on(e,s){this.events[e]||(this.events[e]=[]),this.events[e].push(s);},off(e){delete this.events[e];},trigger(e,...s){this.events[e]&&this.events[e].forEach(n=>n(...s));}},i=a;typeof window!="undefined"?(window.app||(window.app={}),window.app.event=i):typeof globalThis!="undefined"&&(globalThis.app||(globalThis.app={}),globalThis.app.event=i);var r=i;return r;})();//# sourceMappingURL=auto.global.js.map //# sourceMappingURL=auto.global.js.map