@afuggini/emitter
TypeScript icon, indicating that this package has built-in type declarations

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

Readme

Keywords

none

Package Sidebar

Install

npm i @afuggini/emitter

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

13.2 kB

Total Files

16

Last publish

Collaborators

  • afuggini