diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2020-10-29 05:22:48 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2020-10-29 05:22:48 +0300 |
commit | f6121c311b754591a737aec0d3abce299b4908c8 (patch) | |
tree | 44e8a8d8d137cbd37b8a9297e32806fec3ac79c1 /index.js | |
parent | 8b8a93ed85a7546ce30123044e89443d6c62c624 (diff) |
standard
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -207,7 +207,7 @@ class WebTorrent extends EventEmitter { * @param {Object} opts torrent-specific options * @param {function=} ontorrent called when the torrent is ready (has metadata) */ - add (torrentId, opts = {}, ontorrent) { + add (torrentId, opts = {}, ontorrent = () => {}) { if (this.destroyed) throw new Error('client is destroyed') if (typeof opts === 'function') [opts, ontorrent] = [{}, opts] @@ -223,7 +223,7 @@ class WebTorrent extends EventEmitter { const onReady = () => { if (this.destroyed) return - if (typeof ontorrent === 'function') ontorrent(torrent) + ontorrent(torrent) this.emit('torrent', torrent) } |