admin管理员组文章数量:1391811
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))
本文标签: javascriptRxJS How to import JustStack Overflow
版权声明:本文标题:javascript - RxJS: How to import Just - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744767137a2624108.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论