RxJS6 is version 6 of Reactive Extensions for JavaScript, with some added changes in websocket, testing and bug fixes.
Questions tagged [rxjs6]
1219 questions
30
votes
5 answers
Error: : fromEvent is not declared writable or has no setter
The old code uses rxjs v5.5.12, We copied the same code to our new project which uses rxjs v6.4.0. We are getting this error when we tried to run the test case.
Old Code:
import * as ObservableEvents from…

Raju
- 319
- 1
- 3
- 7
30
votes
1 answer
How to detect rxjs related memory leaks in Angular apps
Is there any tool or technique to detect "left behind" or "currently alive" observables, subscriptions.
Just recently discovered a pretty nasty memory leak where components were kept alive due to missing "unsubscribe" calls. I read about "takeUntil"…

robert
- 5,742
- 7
- 28
- 37
29
votes
2 answers
What is the point of using SubSink instead of a Subscriptions array
I just watched a ngConf video of John Papa talking about SubSink as a best practice in order to unsubscribe from obversables.
I was actually using Subscriptions[] then push subscriptions into it then forEach unsubscribe at cmp destroy.
Is their…

The Segfault
- 939
- 1
- 10
- 23
25
votes
3 answers
When should we use the RxJS tap operator?
I do not understand from the docs. Could anyone explain it to me?

Indraraj26
- 1,726
- 1
- 14
- 29
25
votes
1 answer
How to propagate errors through catchError() properly?
I wrote a function that is pipe-able:
HandleHttpBasicError()
{
return ((source:Observable) => {
return source.pipe(
catchError((err:any) => {
let msg = '';
if(err && err instanceof…

dc-p8
- 784
- 1
- 6
- 19
23
votes
4 answers
How to keep observable alive after error in RxJS 6 and Angular 6
Can anyone help with the scenario where this._getReactions$.next() not working whenever this.http.get(...) gets an error. I want to keep observable alive to take the next input.
private _getReactions$: Subject = new Subject();
…

Krishna
- 760
- 3
- 14
- 30
23
votes
2 answers
How do I use catchError() and still return a typed Observable with rxJs 6.0?
cdSo I'm trying to migrate some of my Angular 5 code to 6, and I understand most of the changes required for rxjs to work using the .pipe() operator. It works as you would expect for 'pipable' operations.
However, the behavior of catchError() is…

Rick Strahl
- 17,302
- 14
- 89
- 134
22
votes
8 answers
Angular 6: Property 'catch' does not exist on type 'Observable'?
I am upgrading my app to Angular 6. I am upgrading from Angular 4, but the code below is causing errors in Angular 6, where it worked fine in Angular 4.
The errors I am getting:
Property 'of' does not exist on type 'typeof Observable'
Error:…

Shubham Verma
- 8,783
- 6
- 58
- 79
22
votes
2 answers
I dont get rxjs 6 with angular 6 with interval, switchMap, and map
I want to update my rxjs code to 6 got I don't get it.
Before I had the below that wouth poll for new data every 5 seconds:
import { Observable, interval } from 'rxjs';
import { switchMap, map } from 'rxjs/operators';
var result =…

Tampa
- 75,446
- 119
- 278
- 425
21
votes
2 answers
rxjs 6 Property 'of' does not exist on type 'typeof Observable'
Just moved from rxjs 5/angular 5 to rxjs 6/ angular 6, went through this migration-guide. Can't seem to figure out what it should be now, any help appreciated.
import { Observable, of } from 'rxjs';
[ts] 'of' is declared but its value is never…

alphapilgrim
- 3,761
- 8
- 29
- 58
19
votes
4 answers
How to import rxjs timer in angular 6?
I tried importing rxjs timer on my angular 6 project like
import { timer } from 'rxjs/observable/timer';
I also tried it like,
Rx.Observable.timer(200, 100)
They don't work
Here is the code on plunker

anonymous
- 1,499
- 2
- 18
- 39
18
votes
2 answers
Do I need to `complete()` takeUntil Subject inside ngOnDestroy?
To avoid Observable memory leaks inside Components, I am using takeUntil() operator before subscribing to Observable.
I write something like this inside my components:
private unsubscribe$ = new Subject();
ngOnInit(): void {
this.http
…

Goga Koreli
- 2,807
- 1
- 12
- 31
18
votes
3 answers
Loop array and return data for each id in Observable
Using RxJS v6 is challenging to retrieve data from sub collection for every item in the loop. There is no way to iterate throw array that is retrieved from HTTP call. Merge map does it only for single item where there is a requirement to do it on…

Luke
- 386
- 1
- 4
- 15
18
votes
2 answers
Using RxJS with filter(Boolean) for queries?
I'm reading through some code with the snippet:
search(query: string) {
of(query).
pipe(
filter(Boolean),
debounceTime(300),
Is filter(Boolean) essentially the same thing as filter(v=>!!v)?

Ole
- 41,793
- 59
- 191
- 359
18
votes
6 answers
How to make a sequence of http requests in Angular 6 using RxJS
I've been looking for a solution all over the web, but couldn't find anything that fits my user case. I'm using the MEAN stack (Angular 6) and I have a registration form. I'm looking for a way to execute multiple HTTP calls to the API and each one…

Andi Aleksandrov
- 443
- 2
- 6
- 16