diff --git a/src/emitter.js b/src/emitter.js index 93e212c05b..a2f68e3324 100644 --- a/src/emitter.js +++ b/src/emitter.js @@ -20,4 +20,20 @@ eventEmitter.all = function(events, callback) { } }; +eventEmitter.any = function(events, callback) { + for (var ev in events) { + if (events.hasOwnProperty(ev)) { + (function(ev) { + eventEmitter.on(events[ev], function() { + if (events !== null) { + callback(); + } + + events = null; + }); + }(ev)); + } + } +}; + module.exports = eventEmitter; \ No newline at end of file