Simple EventEmitter implementation.
Event emitter.
Kind: global class
Properties
Name | Type | Description |
---|---|---|
events | Map |
Event listener map |
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 |
Unregister listener.
Kind: instance method of EventEmitter
Param | Type | Description |
---|---|---|
[event] | string |
Event name. |
[listener] | function |
Same function that was registered. |
Emit event with arguments.
Kind: instance method of EventEmitter
Param | Type | Description |
---|---|---|
event | string |
Event name. |
...args | any |
Arguments to pass to listeners. |