Reactive-Extensions / rx-node

RxJS Bindings for Node.js and io.js
Other
219 stars 30 forks source link

Integration with normal RxJs streams #21

Open baldassarreFe opened 7 years ago

baldassarreFe commented 7 years ago

I am trying to run an interval stream until some input comes from sdtin, however this code:

var RxNode = require('rx-node');
const Rx = require('rxjs');

Rx.Observable
  .interval(100)
  .takeUntil(RxNode.fromStream(process.stdin))
  .subscribe(console.log);

results in:

TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at Object.subscribeToResult (.../node_modules/rxjs/util/subscribeToResult.js:73:27)
    at new TakeUntilSubscriber (.../node_modules/rxjs/operator/takeUntil.js:65:38)
    at TakeUntilOperator.call (.../node_modules/rxjs/operator/takeUntil.js:51:33)
    at Observable.subscribe (.../node_modules/rxjs/Observable.js:42:22)
    at Object.<anonymous> (.../test.js:7:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

How do I make RxNode Observables behave like RxJs?

QuentinRoy commented 7 years ago

If you are using rxjs5, it is not compatible with this library.