This commit is contained in:
Chris Blanchard 2015-08-11 13:02:31 +01:00
parent affa015258
commit 54e67d14f7

View file

@ -18,21 +18,9 @@ function Gather (options) {
if (!(this instanceof Gather)) {
return new Gather(options);
}
let noop = () => {};
if (options && typeof options.onEvent === 'function') {
this.onEvent = options.onEvent;
} else {
this.onEvent = noop;
}
if (options && typeof options.onDone === 'function') {
this.onDone = options.onDone;
} else {
this.onDone = noop;
}
this.onDone = (options && typeof options.onDone === 'function') ? options.onDone : noop;
this.onEvent = (options && typeof options.onEvent === 'function') ? options.onEvent : noop;
this.TEAM_SIZE = 6;
this.gatherers = [];
this.ELECTION_INTERVAL = 300000; // 5 mins