UNPKG

@mr-samani/event-bus

Version:

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

2 lines 279 B
var i={events:{},on(s,t){this.events[s]||(this.events[s]=[]),this.events[s].push(t);},off(s){delete this.events[s];},trigger(s,...t){this.events[s]&&this.events[s].forEach(e=>e(...t));}},n=i;export{n as default};//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map