Tiny eventbus lib for typescript
yarn add tiny-eventbus
import eventbus from 'tiny-eventbus'
eventbus.on('test', (params) => {
console.log(params)
})
eventbus.emit('test', {
value: 'hello',
})
on
: subscribe an event
once
: subscribe an event for once
emit
: publish an event
off
: unsubscribe an event
removeAll
: remove add events