mobx-utils
mobx-utils copied to clipboard
toStream should produce an iterable, for better compatiblity with other libs
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 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?
Ah probably rx
itself doesn't support Symbol.observable
yet? Adding support for Symbol.iterable
as well around here will probably fix the issue
Closed for inactivity
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