re-emitter
Advanced tools
Comparing version 0.2.0 to 0.3.0
21
index.js
var slice = Array.prototype.slice | ||
, EventEmitter = require("events").EventEmitter | ||
, reemit = require("./reemit") | ||
@@ -15,21 +16,1 @@ ReEmitter.reemit = reemit | ||
} | ||
function reemit(source, target, events) { | ||
events.forEach(proxyEvent, { | ||
source: source | ||
, target: target | ||
}) | ||
} | ||
function proxyEvent(eventName) { | ||
var source = this.source | ||
, target = this.target | ||
source.on(eventName, propagate) | ||
function propagate() { | ||
var args = [].slice.call(arguments) | ||
args.unshift(eventName) | ||
target.emit.apply(target, args) | ||
} | ||
} |
{ | ||
"name": "re-emitter", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Re emit events from another emitter", | ||
@@ -19,3 +19,5 @@ "keywords": [], | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"to-array": "~0.1.3" | ||
}, | ||
"devDependencies": {}, | ||
@@ -22,0 +24,0 @@ "licenses": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3639
8
47
1
+ Addedto-array@~0.1.3
+ Addedto-array@0.1.4(transitive)