Skip to content

Commit

Permalink
The returned value of the source emitter should also be considered
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrtribeiro committed Apr 8, 2019
1 parent d777036 commit 4487005
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ function propagate(events, source, dest) {
var oldEmit = source.emit;

source.emit = function(eventType) {
oldEmit.apply(source, arguments);
var handled = false;
var handled = oldEmit.apply(source, arguments);
if (! events || ~events.indexOf(eventType)) {
handled = dest.emit.apply(dest, arguments);
handled = dest.emit.apply(dest, arguments) || handled;
}
return handled;
}
Expand Down

0 comments on commit 4487005

Please sign in to comment.