remove emitter

v1.18.x
Baris Usakli 6 years ago
parent 9251912282
commit 8b8feb5b88

@ -1,35 +0,0 @@
'use strict';
var eventEmitter = new (require('events')).EventEmitter();
eventEmitter.all = function (events, callback) {
var eventList = events.slice(0);
events.forEach(function onEvent(event) {
eventEmitter.on(event, function () {
var index = eventList.indexOf(event);
if (index === -1) {
return;
}
eventList.splice(index, 1);
if (eventList.length === 0) {
callback();
}
});
});
};
eventEmitter.any = function (events, callback) {
events.forEach(function onEvent(event) {
eventEmitter.on(event, function () {
if (events !== null) {
callback();
}
events = null;
});
});
};
module.exports = eventEmitter;
Loading…
Cancel
Save