'NgRx - public variable loses it's value after forkJoin with Angular 8

I encountered a strange behaviour with forkJoin:

@Input() userId; // userId is now defined

forkJoin([
        this.apiService.getUserProfile(this.userId), // userId is still defined
        this.apiService.getUserData(this.userId),
      
      ]).subscribe((res: any) => {
      // do something ....

});

calcUserData(){

    here userId is undefined ....
    this.apiService.calcUserData(this.userId).subscribe((res)=>{
       // do something ....
     })

}

So as you can see - after forkJoin the value of userId is undefined ... wonders why... what's wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source