mobx-utils icon indicating copy to clipboard operation
mobx-utils copied to clipboard

toStream should produce an iterable, for better compatiblity with other libs

Open phiresky opened this issue 7 years ago • 4 comments

Just spent some time trying to get it to work with the npm package rx but it didn't work. I only noticed I had to use RxJS 5 (npm package rxjs) when I looked at the relevant tests file. With RxJS 5 the examples work fine.

The errors were: (toStream)

Uncaught TypeError: Object is not iterable
    at getIterable (rx.all.js:2706)
    at FromObservable.subscribeCore (rx.all.js:2634)
    at FromObservable.tryCatcher (rx.all.js:63)
    at setDisposable (rx.all.js:2082)

(fromStream)

Cannot read property fn of undefined
(forgot to save stack trace)

phiresky avatar Jan 26 '17 01:01 phiresky

@phiresky the goal is to be compatible with any stream library through Symbol.observable. Did you test it in an environment that supports Symbols without accidentally compiling / polyfilling down to ES5?

mweststrate avatar Jan 26 '17 07:01 mweststrate

Ah probably rx itself doesn't support Symbol.observable yet? Adding support for Symbol.iterable as well around here will probably fix the issue

mweststrate avatar Jan 26 '17 08:01 mweststrate

Closed for inactivity

mweststrate avatar Jun 13 '17 14:06 mweststrate

Smth related I think... https://github.com/benlesh/symbol-observable/issues/38 In angular I had to add polyfill: import 'core-js/features/symbol/observable'; As mentioned above Symbol.observable is not supported for some reason in rxjs

hudzenko avatar Aug 01 '19 09:08 hudzenko