Skip to content

liujiapeng/easy-eventbus

Repository files navigation

easy-eventbus

Tiny eventbus lib for typescript

install


yarn add tiny-eventbus

use


import eventbus from 'tiny-eventbus'
eventbus.on('test', (params) => {
  console.log(params)
})

eventbus.emit('test', {
  value: 'hello',
})

api


on : subscribe an event

once: subscribe an event for once

emit : publish an event

off: unsubscribe an event

removeAll: remove add events

About

eventbus lib for typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published