Socket
Socket
Sign inDemoInstall

ee-event-emitter

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-event-emitter - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

26

lib/EventEmitter.js

@@ -43,3 +43,3 @@ !function(){

else if (event === 'error') {
errs = Array.prototype.slice.call(args, 1).filter(function(a){
errs = Array.prototype.slice.call(args, 1).filter(function(a){
return a instanceof Error;

@@ -87,3 +87,25 @@ });

/**
* listens for an event and passes it directly to this
* instance of the eventemitter
*
* @param {string} eventName the name of the event to emit
* @returns {function} event listener that passes the event
* to this class
*/
, passEvent: function(eventName) {
return function() {
var args = [eventName];
// convert args to array (since Array.from or
// the spread operator are not available yet)
for (var i = 0, l = arguments.length; i < l; i++) args.push(arguments[i]);
// emit what we got
this.emit.apply(this, args);
}.bind(this);
}
// add one ( two args ) or multiple events ( one arg -> object ). fired once.

@@ -118,3 +140,3 @@ , once: function(event, listener) {

// adds a listenr, somehow private
, addListener: function(event, listener, once) {
, addListener: function(event, listener, once) {
if (!this.___events[event]) this.___events[event] = [];

@@ -121,0 +143,0 @@

2

package.json
{
"name" : "ee-event-emitter"
, "description" : "A portable event emitter class"
, "version" : "0.2.2"
, "version" : "0.3.0"
, "homepage" : "https://github.com/eventEmitter/ee-event-emitter"

@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc