Questions tagged [rxjs6]

RxJS6 is version 6 of Reactive Extensions for JavaScript, with some added changes in websocket, testing and bug fixes.

1219 questions
7
votes
3 answers

RxJS6 asObservable() needed on a Subject?

When is asObservable() needed on a Subject (e.g. BehaviorSubject) to get a observable of the subject? The subject isself can be casted to an Observable as well. Questions What are the technical differences between name1$ and name2$? Which one…
Horace P. Greeley
  • 882
  • 1
  • 10
  • 18
7
votes
2 answers

Should I use multiple BehaviorSubject for different subscriptions?

I have some sibling components and a DataService in my Angular (v7) project and I call methods as the following scenario: TicketComponent adds ticket and calls reloadTickets method in TicketListComponent and similarly FileComponent adds file and…
Jack
  • 1
  • 21
  • 118
  • 236
7
votes
1 answer

How to replace flatMap and mergeMap in rxjs 6.4.0 Angular

I have an interceptor in my Angular 7 app that makes a request to get the token before re-issuing the request. If multiple requests come in at once then they will all make a request to get the token. To avoid that I share an observable so that the…
Vending Panda
  • 75
  • 1
  • 1
  • 5
7
votes
2 answers

RxJS updated, Property 'merge' does not exist on type 'typeof Observable'

I updated my material angular project to include an expandable detail row in my table. I needed to upgrade to rsjx 6 for this. Now I get the following error. I'm totally new with angular, so unfortunately I don't have a clue how to resolve…
dgtl whiz
  • 73
  • 1
  • 3
7
votes
4 answers

pause/resume a timer Observable

I'm building a simple stopwatch with angular/rxjs6, I can start the timer but I can't pause/resume it. source: Observable; subscribe: Subscription; start() { this.source = timer(0, 1000); this.subscribe = this.source …
Mostafa Attia
  • 327
  • 5
  • 13
7
votes
1 answer

Error: rxjs/operator/map has no exported member 'map'

I'm migrating from angular 5 to angular 6. When I make npm run build, I'm it is throw to the console the following error: error TS2305: Module …
Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130
7
votes
1 answer

usng rxjs-5-to-6-migrate correctly. issues with tsconfig path

The documentation to use rxjs-5-to-6-migrate states the following: To refactor TypeScript code so that it doesn't depend on rxjs-compat, you can use rxjs-tslint. npm i -g rxjs-tslint rxjs-5-to-6-migrate -p [path/to/tsconfig.json] So I did that…
weridpotato
  • 261
  • 1
  • 3
  • 11
7
votes
1 answer

Angular 6 unit test rxjs 6 operator tap unit test interceptor

Since I update my code to the new Rxjs 6, I had to change the interceptor code like this: auth.interceptor.ts: ... return next.handle(req).pipe( tap((event: HttpEvent) => { if (event instanceof HttpResponse) { // do…
Pedro Tainha
  • 497
  • 2
  • 6
  • 14
7
votes
4 answers

Angular v6, rxjs v6 error TS2339: Property 'pipe' does not exist on type 'OperatorFunction

I have updated code that worked fine with Angular 5.5/rxJS5.5 using the new pipe method to Angular 6/rxJS6 using the rxjs-lint package and the following commands npm i -g rxjs-tslint rxjs-5-to-6-migrate -p tsconfig.json Imports etc have been…
user8713457
  • 75
  • 1
  • 1
  • 7
7
votes
1 answer

Create classes for Single, Maybe and Completable in RxJS 6

It's a good practice to create my own Observable extended classes? i want to implement my own Single and Completable classes for the sake of know the amount or absence of data than and observable can return and i want it as a class because i use…
7
votes
4 answers

mergeMap does not exist on type observable

I am trying to use mergeMap in rxjs6 and i am getting this error: Property 'mergeMap' does not exist on type 'Observable<{}>' I have tried import 'rxjs/add/operator/mergeMap'; and it is not working. What am i doing wrong? import {from, Observable}…
prolink007
  • 33,872
  • 24
  • 117
  • 185
6
votes
3 answers

How should I emit a single value when observable completes?

I want to emit one value when the original observable completes let's say like below, using the imaginary operator mapComplete: let arr = ['a','b', 'c']; from(arr) .pipe(mapComplete(()=>'myValue')) .pipe(map((v)=>`further processed:…
Marinos An
  • 9,481
  • 6
  • 63
  • 96
6
votes
3 answers

Multiple subscriptions nested into one subscription

I find myself puzzled trying to set a very simple rxjs flow of subscriptions. Having multiple non-related subscriptions nested into another. I'm in an angular application and I need a subject to be filled with next before doing other…
6
votes
1 answer

How to fix " Property 'wheelDelta' does not exist on type 'WheelEvent' " while upgrading to angular 7,rxjs6?

I'm upgrading to angular7 with rxjs6: in mouseWheelEvent type I am getting "Property 'wheelDelta' does not exist on type 'WheelEvent'". Do we have any alternative for wheelDelta? mouseWheelFunc(event: MouseWheelEvent): void { // var event =…
6
votes
2 answers

Why rxjs debounceTime does not work on observables created using 'of' operator?

Using angular 7 and rxjs 6: Why the following does not debounce? onChange(val: string) { of(val) .pipe( debounceTime(300) ).subscribe(valx => { console.log(valx); …
kmansoor
  • 4,265
  • 9
  • 52
  • 95