I'm making 2 API requests calls with typed responses, combining them into a single Observable.forkJoin
. I want to get both results in different typed variables.
var observableOrganization: Observable<Organization> = this.getOrganizationDetails();
var observablePromotion: Observable<Promotion[]> = this.getPromotions();
Observable.forkJoin([ observableOrganization, observablePromotion])
.subscribe(
response => {
organization: Organization = response[0];
promotions: Promotion[] = response[1];
},
error => {
// ...
}
);
How can I reach typed results in single subscribe response?