JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q35605F
  • License MIT

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

Package Exports

  • can-stream-rxjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (can-stream-rxjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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