Negotiate Pushing Milestone
Wondering what’s next for npm?Check out our public roadmap! »

@afuggini/emitter

1.1.0 • Public • Published

Emitter

Simple Event Emitter module.

Example

var EventEmitter = require('@afuggini/emitter')
 
var emitter = new EventEmitter()
 
emitter.on('someEvent', function (arg) {
  console.log(arg)
})
 
emitter.emit('someEvent', 'It works!!!')
 
// 'It works!!!'

API

on(eventName: string, listener: Function)

one(eventName: string, listener: Function)

off(eventName: string, listener: Function)

emit(eventName: string[, ...arguments: any])

Testing

yarn test or yarn test:watch

License

MIT

Author

@afuggini

Keywords

none

Install

npm i @afuggini/emitter

DownloadsWeekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

13.2 kB

Total Files

16

Last publish

Collaborators

  • avatar