UNPKG

@mr-samani/event-bus

Version:

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

2 lines 290 B
'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;module.exports=n;//# sourceMappingURL=index.cjs.map //# sourceMappingURL=index.cjs.map