RxJS: How to Import Just

I would like to use RxJS just.
For this I need Observable.just(null)what is impossible to do with Observable.from().

I'm trying to

import 'rxjs/add/operator/just';

But it is not present where it should be - node_modules/rxjs/add/operatortherefore it will not compile.

How can I add this statement?

+4
source share
1 answer

It depends on the version of Rx.js:

Like this:

Rx.Observable.of(null).forEach(x => console.log(x))
+11
source

Source: https://habr.com/ru/post/1663577/


All Articles