diff --git a/client.js b/client.js index 9560fe4..6ddf184 100644 --- a/client.js +++ b/client.js @@ -127,9 +127,9 @@ class Client extends EventEmitter { * @param {number=} opts.left (if not set, calculated automatically) */ start (opts) { - debug('send `start`') opts = this._defaultAnnounceOpts(opts) opts.event = 'started' + debug('send `start` %o', opts) this._announce(opts) // start announcing on intervals @@ -147,9 +147,9 @@ class Client extends EventEmitter { * @param {number=} opts.left (if not set, calculated automatically) */ stop (opts) { - debug('send `stop`') opts = this._defaultAnnounceOpts(opts) opts.event = 'stopped' + debug('send `stop` %o', opts) this._announce(opts) } @@ -162,10 +162,10 @@ class Client extends EventEmitter { * @param {number=} opts.left (if not set, calculated automatically) */ complete (opts) { - debug('send `complete`') if (!opts) opts = {} opts = this._defaultAnnounceOpts(opts) opts.event = 'completed' + debug('send `complete` %o', opts) this._announce(opts) } @@ -178,9 +178,9 @@ class Client extends EventEmitter { * @param {number=} opts.left (if not set, calculated automatically) */ update (opts) { - debug('send `update`') opts = this._defaultAnnounceOpts(opts) if (opts.event) delete opts.event + debug('send `update` %o', opts) this._announce(opts) }