Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-04-01 06:36:56 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-04-01 06:36:56 +0300
commit7a5f498a79a7342f4ef61d03f4f55811091ce619 (patch)
treec7e9f9a8000e8776406687181d322bb181b417a9 /lib
parentb90e4427ea47d6fce0782120182aaa0d42b5914b (diff)
remove re-emitter dependency
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 2cc0800..d4a8e2c 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -24,7 +24,6 @@ var pathExists = require('path-exists') // browser exclude
var Piece = require('torrent-piece')
var pump = require('pump')
var randomIterate = require('random-iterate')
-var reemit = require('re-emitter')
var sha1 = require('simple-sha1')
var uniq = require('uniq')
var ut_metadata = require('ut_metadata')
@@ -314,7 +313,15 @@ Torrent.prototype._onSwarmListening = function () {
})
// expose discovery events
- reemit(self.discovery, self, ['trackerAnnounce', 'dhtAnnounce', 'warning'])
+ self.discovery.on('trackerAnnounce', function () {
+ self.emit('trackerAnnounce')
+ })
+ self.discovery.on('dhtAnnounce', function () {
+ self.emit('dhtAnnounce')
+ })
+ self.discovery.on('warning', function (err) {
+ self.emit('warning', err)
+ })
// if full metadata was included in initial torrent id, use it
if (self.info) self._onMetadata(self)