Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

362
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda