Questions tagged [rxjs-observables]

759 questions
2
votes
1 answer

Angular Navbar change when Logged in

I have a navbar in my App component: app.component.html
2
votes
1 answer

Unsubscribe later with takeUntil if a condition is met

I want to unsubscribe to an observable with takeUntil in any case where the number does not equal 5. If the number is 5 want to do something and unsubscribe later, but it does not work. This is my stackblitz link:…
2
votes
1 answer

ngbTypeahead search results missing

I am currently writing an ngbTypeahead search and I am stuck because I have never really worked with Observables, which are the expected return type of the ngbTypeahead search. The search function in my component looks like this: search:…
BoJack Horseman
  • 4,406
  • 13
  • 38
  • 70
2
votes
1 answer

Can you return an array of objects, with each object containing an observable from forkJoin?

let fruit = { id: 1, isGood: false } lets say I have a function call that accepts an id of a fruit object and returns an observable that resolves into a boolean indicating whether the value isGood is true or false. I want to map through an…
2
votes
1 answer

Check if object in array of objects exists against user input in RxJS HTTP Request

Using Data/Action Streams via RxJS, I want to return/pass an error if a user inputs an invalid bay number. My code currently will return a bay object if it matches the number that the user inputs, BUT I can't figure out how to throw an error if the…
2
votes
2 answers

Transform data from one observable using another observable in angular rxjs

I have two observables: cities and addresses. In my addresses array I have an object with a property city_code which has a value and a property city which is empty. In cities I have objects with both properties. How can I transform the data in…
Mr.Milannist
  • 39
  • 1
  • 10
2
votes
2 answers

RxJS. Combine observables that emit less then 1 second apart

There are two observables that may be emiting together or separately: stream1 and stream2. I need my subscription to fire only if stream2 fires less then 1 second after stream1 does. Any way to achieve that with RxJS?
2
votes
0 answers

Detecting change of a BehaviorSubject component member variable updated in a subscribe block?

I have an element in a component view:
Progress: {{ progress$ | async }}
It is supposed to be updated in a continuous way by a next() call in a subscribe() block: progress$: BehaviorSubject = new…
Stephane
  • 11,836
  • 25
  • 112
  • 175
2
votes
1 answer

How to use rxjs for multiple inner nested subscribes

In the below code I have used subscribe inside subscribe. This code works but the code structure is very bad. I would like to refactor this code using rxjs(forkjoin or mergemap).I'm not sure how to achieve this. Can someone help me with this? Any…
mohammed fahimullah
  • 485
  • 1
  • 4
  • 10
2
votes
2 answers

RXJS modify order of subscribers

Is it possible to ensure that a subscriber is the last to be executed in the observer queue? A delay(0) is no option for me since I need the code to be executed in line and not asynchrounus. let observable = new Subject(); //delay(0) no…
tris
  • 863
  • 4
  • 9
  • 22
2
votes
0 answers

change the agm-circle color

I want to change the agm-circle color when the map changes its mode to dark mode. I have a behavior subject as follows in the service file private isDarkModeActiveSubject = new BehaviorSubject(false); readonly isDarkModeActive$ =…
sunil
  • 660
  • 8
  • 20
2
votes
2 answers

Angular BehaviorSubject has delayed update to front-end

I am having issues with a front-end component not rendering updates to a BehaviorSubject and I'm hoping someone can point out where my error is coming from. I have read many other questions about BehaviorSubject issues, but so far I cant get a…
2
votes
1 answer

How To Limit Concurrent API Requests In Angular Using RxJs

I have an Angular 7 application that allows you to multi-upload files. For each file chosen, it makes a request to the server. This isn't great because opening hundreds of concurrent calls seems like a potential problem for my backend servers. What…
Isaiah Fasoldt
  • 190
  • 1
  • 10
2
votes
2 answers

Share a subscription if observable not done

I have an angular application that should sync some data with the server on some conditions (some triggers in software or when user request). So i have a function like this: ... public createSyncObservable(): Observable { …
DSLima90
  • 2,680
  • 1
  • 15
  • 23
2
votes
2 answers

Stop RxJS HTTP Polling after HTTP success response

I have following code that mimics HTTP Requests polling. timeout:Observable = timer(10000); startPollingStackblitz(arnId: string) { const poll:Observable = of({}).pipe( mergeMap(_ => { …
Michael Z
  • 3,883
  • 10
  • 43
  • 57