simple-jseventbus
v1.0.3
Published
simple event bus
Downloads
2
Readme
install
npm i simple-jsevent
usage
import { eventBus } from 'simple-jseventbus'
// 添加监听器
let unSubscrible = eventBus.addListener('eventName', () => {
// TODO
})
// 发送
eventBus.emit('eventName', '...args');
// 移除监听器
unSubscrible();
// 移除事件
eventBus.clearEventByName('eventName');
关键词
typescript; event bus