Permalink
Browse files

forward 'synced' events from scuttlebutt streams

  • Loading branch information...
1 parent a6585a8 commit 8b73bdeedaeb117a329e8b9e2c48b2b27287fb64 @yorickvP yorickvP committed Dec 24, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −1 index.js
  2. +1 −0 lib/seaport.js
View
6 index.js
@@ -53,7 +53,11 @@ exports.connect = function () {
c.on('error', onend);
c.on('close', onend);
- c.pipe(s.createStream()).pipe(c);
+ var stream = s.createStream();
+
+ c.pipe(stream).pipe(c);
+
+ stream.on('synced', s.emit.bind(s, 'synced'));
return c;
View
1 lib/seaport.js
@@ -160,6 +160,7 @@ Seaport.prototype.createStream = function (host) {
var tr = through(write, end);
s.on('data', tr.emit.bind(tr, 'data'));
s.on('end', tr.emit.bind(tr, 'end'));
+ s.on('synced', tr.emit.bind(tr, 'synced'));
s.pipe(tr);
return tr;

0 comments on commit 8b73bde

Please sign in to comment.