0.2.0 • Published 9 years ago

flyd-connect v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

flyd-connect

Travis npm David David

Connects the output of one stream to the input of another.

Signature

Stream -> Stream -> Stream

Usage

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);
// alternatively:
connect(s2).to(s3);

flyd.on((x) => {
  console.log('2x + 1 =', x);
}, s4);

[1, 2, 3, 4, 5]
  .forEach(n => s1(n));

// Output 3
// Output 5
// Output 7
// Output 9
// Output 11
0.2.0

9 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago