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

178
Vistas
RxJs implementing refresh action from Observable chain

trying to implement refresh or poll with rxjs chain.

ngOnInit() {
    const id$ = this.route.params;

    id$.subscribe((params: Params) =>  {
        this.id = params['id'];
        this.userService.getUser(params['id']).subscribe(this.getUserSubject$));
    }

    this.getUserSubject$
      .flatMap(user =>
        Observable.forkJoin(this.userService.getAddress(user), this.userService.isActive(user),
          (address, isActive) => {
            return _.assign({}, user, address, {isActive: isActive});
          }
        )
      )
      .subscribe(user => {
        this.user = user
      }, err => this.error(err));
}

refresh($event) {
    this.userService.getUser(this.id).subscribe(this.getUserSubject$);
}

On refresh call the getUserSubject$ chain is not called. its called just once on ngOnInit. how to push data into the getUserSubject$, so that user is updated. why the observable chain in not called from refresh.

over 4 years ago · Santiago Trujillo
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