Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

351
Views
The output from combineLatestAll() operator seems to be incorrect

I have this little peace of code:

      var s2 = of(6, 16, 26).pipe(map(v1=>of(5, 15, 25).pipe(map(v2=>[v2,v1]))), combineLatestAll());
      s2.subscribe(console.log)

It produces output below - I understand the third output generated (by the time the first stream starts the second one is finished - so it always starts with 25 I guess) but I don't understand why the first two outputs are generated.

[25, 6]
[25, 16]
[5, 26]

[25, 6]
[25, 16]
[15, 26]

[25, 6]
[25, 16]
[25, 26]
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is a timeline of what happens:

O1 [5,6] [15,6] [25,6]

O2                      [5,16] [15,16] [25,16]        

O3                                             [5,26]  [15,26] [25,26]

CLA                              latest O1 ->  [25,6]  [25,6]  [25,6]                                              
                                 latest O2 ->  [25,16] [25,16] [25,16]
                                 latest O3 ->  [5,26]  [15,26] [25,26]

combineLatestAll subscribes to all observables. When you subscribe to a stream such as of(5, 15, 25) it completes before anything else can happen. So observable 1 completes, observable 2 completes and the values emitted by observable 3 are each combined with the latest values from O1 and O2.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!