Skip to content

Commit

Permalink
aggregate: use map instead of foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Mar 24, 2015
1 parent ed8010c commit 56226e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ aggregate.attachListeners = function(emitters) {

function emit() {
var originalArgs = arguments;
var args = [];

debug('Received event: ' + originalArgs[0]);

Object.keys(originalArgs).forEach(function(key) {
args.push(originalArgs[key]);
// cast arguments to array
var args = Object.keys(originalArgs).map(function(key) {
return originalArgs[key];
})

this.emit.apply(this, args);
Expand Down

0 comments on commit 56226e3

Please sign in to comment.