Comparing version 4.2.3 to 4.3.0
13
mux.js
@@ -198,3 +198,5 @@ var protocol = require('hypercore-protocol') | ||
// Start replicating as requested. | ||
this._replicateFeeds(filtered) | ||
this._replicateFeeds(filtered, true, function () { | ||
self.stream.emit('remote-feeds') | ||
}) | ||
} | ||
@@ -204,3 +206,4 @@ | ||
// the main stream. | ||
Multiplexer.prototype._replicateFeeds = function(keys) { | ||
Multiplexer.prototype._replicateFeeds = function(keys, terminateIfNoFeeds, cb) { | ||
if (!cb) cb = () => {} | ||
var self = this | ||
@@ -223,2 +226,4 @@ keys = uniq(keys) | ||
var pending = feeds.length | ||
--self._pendingReplicationFeeds | ||
@@ -235,2 +240,3 @@ | ||
self._feed.close() | ||
process.nextTick(cb) | ||
return | ||
@@ -250,2 +256,3 @@ } | ||
self.stream.expectedFeeds-- | ||
if (!--pending) cb() | ||
return | ||
@@ -274,2 +281,4 @@ } | ||
fStream.once('error', cleanup) | ||
if (!--pending) cb() | ||
}) | ||
@@ -276,0 +285,0 @@ }) |
@@ -5,3 +5,3 @@ { | ||
"author": "Stephen Whitmore <sww@eight.net>", | ||
"version": "4.2.3", | ||
"version": "4.3.0", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "git://github.com/noffle/multifeed.git" |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
26627
620
1