diff --git a/lib/gather/gather.js b/lib/gather/gather.js index bc631c9..81adafe 100644 --- a/lib/gather/gather.js +++ b/lib/gather/gather.js @@ -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