UNPKG

@mr-samani/event-bus

Version:

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

2 lines 324 B
var EventBus=(function(){'use strict';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;return n;})();//# sourceMappingURL=index.global.js.map //# sourceMappingURL=index.global.js.map