An easier way to deal with scuttlebutt streams.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE.txt
README.md
index.js
package.json
test.js

README.md

Scuttlebutt Stream

An easier way to deal with scuttlebutt streams.

var scuttlebutt = require('scuttlebutt-stream');
var Model       = require('scuttlebutt/model');

var m1 = new Model();
var s1 = m1.createStream();

var m2 = new Model();
var s2 = m2.createStream();

var scs = scuttlebutt(function(data) {
	this.queue([ data[0], 'Foo' ]);
});

s1.pipe(scs).pipe(s2);

m1.set('name', 'Drew');

process.nextTick(function() {
	console.log(m1.get('name'), m2.get('name'));
});