I'd like to use RxJS's just
.
What I need it for is Observable.just(null)
, which can't be done with Observable.from()
.
I'm trying
import 'rxjs/add/operator/just';
But it's not present in where it should be - node_modules/rxjs/add/operator
, so this fails to pile.
How can I add this operator?
I'd like to use RxJS's just
.
What I need it for is Observable.just(null)
, which can't be done with Observable.from()
.
I'm trying
import 'rxjs/add/operator/just';
But it's not present in where it should be - node_modules/rxjs/add/operator
, so this fails to pile.
How can I add this operator?
Share Improve this question asked Dec 13, 2016 at 3:00 Ondra ŽižkaOndra Žižka 47k49 gold badges227 silver badges298 bronze badges1 Answer
Reset to default 11That depends on the version of Rx.js:
- 4.0 includes a
.just
method; - 5.0 doesn't. Instead, use the
.of
method.
Like this:
Rx.Observable.of(null).forEach(x => console.log(x))
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744767137a4592528.html
评论列表(0条)