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

104
Vistas
Why in this situation next function doesn't send information?

I'm learning Subject from RXJS and I don’t understand why in this situation the next() function doesn’t send the information:

import {Subject, from} from 'rxjs';

const subject = new Subject<any>();

subject.subscribe({
    next: (v) => console.log(`observerA: ${v}`),
});
subject.subscribe({
    next: (v) => console.log(`observerB: ${v}`),
});

const observable = from([1, 2, 3]);
observable.subscribe(subject);

subject.next(4) // not working
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you update with complete then you will see that it automatically completed when you pass directly subject to subscribe.

subject.subscribe({
    next: (v) => console.log(`observerA: ${v}`),
    error: (error) => console.log(error),
    complete: () => console.log('completed') 
});
about 4 years ago · Santiago Trujillo 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