I have properties
currentApplication: IApplicationModel;
logos: IImagesModel[];
backgrounds: IImagesModel[];
And I have three observables like this:
loadApplication(): Observable<IApplicationModel> {
return this.applicationService.getById(this.applicationId);
}
loadApplicationLogos(): Observable<IImagesModel[]> {
return this.applicationService.getApplicationFiles(this.applicationId, "logo");
}
loadApplicationOldBackgrounds(): Observable<IImagesModel[]> {
return this.applicationService.getApplicationFiles(this.applicationId, "background");
}
and they do not depend on each other. I want to have ONE subscription, for example with mergeMap(), but I want also to assign the result of each observable.
this.loadApplication()
.pipe(
mergeMap(application => this.loadApplicationLogos()),
mergeMap(application => this.loadApplicationOldBackgrounds()),
)
.subscribe(res => {
})
How I can assign applications and logos to currentApplication and logos ? Should I use tap() before every mergeMap() or is there a better way with something different from mergeMap?