In JsBin, I got error "Rx.Observable.just is not a function" in Firefox & Chrome. JsBin example : http://jsbin.com/vunuta/edit?html,js,console
HTML :
script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js">
Typescript :
Rx.Observable.from ([1,2,3]).subscribe(x => console.log(x)); // Work
Rx.Observable.just (99).subscribe(x => console.log(x)); // Fail
Rx.Observable.return (99).subscribe(x => console.log(x)); // Fail
Tx
Rx.Observable.just()
is no longer provided in v5. Use Rx.Observable.of()
. https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md
Update for rxjs v6
Yes, use of
instead of just
. The import and usage of of
changed between rxjs v5 and rxjs v6.
For rxjs v6, use of
as in the following example code:
import { of } from "rxjs";
let source$ = fromPromise(getPostById(1)).pipe(
flatMap(post => {
return hydrateAuthor(post);
}),
catchError(error => of(`Caught error: ${error}`))
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With