Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

352
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda