Connects the output of one stream to the input of another.
import flyd from 'flyd';
import connect from 'flyd-connect';
const s1 = flyd.stream();
const s2 = s1.map(x => x * 2);
const s3 = flyd.stream();
const s4 = s2.map(x => x + 1);
connect(s2, s3);
connect(s2).to(s3);
flyd.on((x) => {
console.log('2x + 1 =', x);
}, s4);
[1, 2, 3, 4, 5]
.forEach(n => s1(n));