Partially implements the Node.js events module for environments that do not have it, like browsers
Fast & 525B gzipped (because size matters)
npm install @bastienrobert/events
import EventEmitter from '@bastienrobert/events'
const eventEmitter = new EventEmitter()
eventEmitter.on('foo', bar => {
console.log(bar)
})
eventEmitter.emit('foo', 'here we go!')
See the Documentation. You can check the Node.js EventEmitter docs too, most methods are implemented in this package.
Generated using TypeDoc