0.1.6 • Published 7 years ago

can-stream-rxjs v0.1.6

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

can-stream-rxjs

Build Status

Stream values into and out of computes using can-stream + rxjs

Syntax

canStream.toStream([compute]);

canStream.toCompute([stream]);

Example Usage

toStream

var canStream = require('can-stream-rxjs');

var c = compute(0);

var stream = canStream.toStream(c);

var computeVal;

stream.subscribe((newVal) => {
	computeVal = newVal;
});

c(1);

console.log(computeVal); //1

toCompute

const c = canStream.toCompute(setStream => setStream);

c(5);
// listen to the compute for it to have a value
c.on('change', () => {});

// immediate value
c() //5

testing

npm test
0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago