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

134
Vistas
Is an event subscribed to an observable still fired on refresh?

I have an issue which I have been figuring out for a while now. I have this piece of code:

this.service.process(this.Object.id, this.Object.userId,this.pageNr)
.subscribe((data) => {
    this.processed.emit(this.pageNr);
});

Now when debugging I see that the process method is called, when I refresh in the middle of the process, I do not see the processed.emit().

So, is it possible that on refresh the process( which is one transaction) goes through, but subscribed "processed" does not happen?

If someone could give a link to more information that would be awesome, or maybe information about how to avoid this.

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

Try this to avoid multiple subscription:

subscription:Subscription

    ...
    
if(!!this.subscription){
// unsubsribe from old subscription
this.subscription.unsubscribe();

}
this.subscription = this.service.process(this.Object.id, this.Object.userId,this.pageNr)
.subscribe((data) => {
    this.processed.emit(this.pageNr);
});
about 4 years ago · Santiago Gelvez 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