Questions tagged [combinelatest]

137 questions
2
votes
1 answer

Subscribe to all observables in a combineLatest

In my code I open a matDialog allowing XLSX extraction. When opening this matDialog, data is loaded into the ngOnInit(), which may take some time. That's why I use combineLatest() with filter() allowing me to wait for the result of the three queries…
Quentin
  • 1,865
  • 2
  • 24
  • 40
2
votes
2 answers

RXJS - Angular : Two Observable should return Observable

I want to evaluate two observable and I would like to save the flow in another observable. I tried combineLatest(obs1$, obs2$); but it generates an observable<[boolean, boolean]>. Is there a better function than combineLatest to…
user9923760
  • 596
  • 2
  • 8
  • 18
2
votes
1 answer

CombineLatest is not taking the latest value in rxjs

this is the code const timerOne = timer(1000, 4000).pipe( map(x=>`1-${x}-${new Date().getSeconds()}`) ) //timerTwo emits first value at 2s, then once every 4s const timerTwo = timer(2000, 4000).pipe( map(x=>`2-${x}-${new…
Lijin Durairaj
  • 4,910
  • 15
  • 52
  • 85
2
votes
1 answer

Flutter combine observables

I want to combine two observables and get both values when each of then is changed. According to https://pub.dartlang.org/documentation/rxdart/latest/rx/Observable/combineLatest2.html and its marble diagram, it's exactly what I want. So, I…
niegus
  • 1,698
  • 4
  • 22
  • 34
2
votes
1 answer

How to trigger again HttpGet request in Angular 6?

I'm using combineLatest to merge data from websocket and database into one object. Each time the websocket sends data my data are refreshing. Although I'd like to refresh data at page manually also by pressing the button. Unfortunately combineLatest…
Amandill
  • 23
  • 4
2
votes
2 answers

RxJava: behaviour of combineLatest

I have the following code: final Observable a = Observable.just("a1", "a2"); final Observable b = Observable.just("b1"); final Observable c = Observable.combineLatest(a, b, (first, second) -> first +…
Carsten
  • 468
  • 4
  • 16
2
votes
1 answer

How to ignore one of observables in combineLatest, but have its latest available in the combiner function?

I have this real world scenario. I have a ReaderConfig object, which is a dumb tuple of ReaderTheme, ReaderFont, ReaderFontSize. Its changes will trigger the readerConfigObservable which then redraws stuff. So the solution sofar is…
urSus
  • 12,492
  • 12
  • 69
  • 89
2
votes
2 answers

Refreshing list using combineLatest: Angular2 + RxJS

I have a component in which I am displaying a table of data (users) generated from an http request to an API. There are a variety of filters on the table so I generate the table data as follows: this.displayUsers$ = Observable.combineLatest( …
natmegs
  • 121
  • 2
  • 16
2
votes
1 answer

combineLatest behaviour in Rxjs 5?

Looking at the definition of combineLatest Combines multiple Observables to create an Observable whose values are calculated from the latest values of each of its input Observables. or Whenever any input Observable emits a value, it computes a…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
1
vote
1 answer

ConcatMap with CombineLatest creating more calls than expected

I have an ngrx action/effect that takes a FileList and uploads them sequentially to the server. After the first File is uploaded, an ID will be generated that needs to be used by the second File as argument, so it can be later related to the first…
Luis Lavieri
  • 4,064
  • 6
  • 39
  • 69
1
vote
0 answers

Swift UI Search app view model return nil error on unit testing

I am trying to test the search function. When I enter the text App, it should return 3 records, but instead it returns nil and showing error testSearcFruit_success_WithLatter_A(): XCTAssertEqual failed: ("0") is not equal to ("3") - Total is empty I…
Nus
  • 35
  • 5
1
vote
2 answers

Subscribe to multiple observables and emit value when each is completed

On my ngOnInit() I have this code: combineLatest([ obs1, obs2, obs3]).subscribe(([obs1Res, Obs2Res, Obs3Res]) => { }) and the result is emitted once when they are completed. Is there a way to emit for each new completed observable and get a result…
N. St
  • 15
  • 2
1
vote
2 answers

How does combineLatest RxJS operator works when multiple observables emit values at the same time?

The RxJS Documentation states that combineLatest Combines multiple Observables to create an Observable whose values are calculated from the latest values of each of its input Observables. I want to understand how combineLatest works when multiple…
1
vote
0 answers

How to track time with an Observable?

I have http observable and I want to add a timer to run parallel with it. For example, I want to show loading in at least 3s, so if http response before that, I want it to wait till timer emit after 3s. But if http took too long, say more than 5s,…
1
vote
1 answer

Rxjs wait for observable

The problem that I'm trying to solve is: A) get some data from backend then set it as global variable (let's say) B) if data from A) is set then react for an button click on UI and emit next value on BehaviourSubject C) when the data from A) is set…
1 2
3
9 10