javascript - RxJS: How to import Just - Stack Overflow

I'd like to use RxJS's just.What I need it for is Observable.just(null), which can't be

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 badges
Add a ment  | 

1 Answer 1

Reset to default 11

That 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

相关推荐

  • javascript - RxJS: How to import Just - Stack Overflow

    I'd like to use RxJS's just.What I need it for is Observable.just(null), which can't be

    16小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信