Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!