@hamgom95/eventemitter

0.2.0 • Public • Published

@hamgom95/eventemitter

Simple EventEmitter implementation.

API Documentation

EventEmitter

Event emitter.

Kind: global class
Properties

Name Type Description
events Map Event listener map

eventEmitter.on(event, listener, opts)

Register event listener

Kind: instance method of EventEmitter

Param Type Description
event string Event name
listener function Listener callback
opts Object Options
opts.prepend boolean Whether to prepend listener
opts.once boolean Whether to use listener once only

eventEmitter.off([event], [listener])

Unregister listener.

Kind: instance method of EventEmitter

Param Type Description
[event] string Event name.
[listener] function Same function that was registered.

eventEmitter.emit(event, ...args)

Emit event with arguments.

Kind: instance method of EventEmitter

Param Type Description
event string Event name.
...args any Arguments to pass to listeners.

Readme

Keywords

Package Sidebar

Install

npm i @hamgom95/eventemitter

Weekly Downloads

1

Version

0.2.0

License

ISC

Unpacked Size

5.84 kB

Total Files

4

Last publish

Collaborators

  • hamgom95