Is there a more efficient way to convert an Observable of Observables into an array of Observables in my pipe method? Here is the scenario:
// The type of "observables" is Observable<Observable<MyType>[]>
const observables = this.http.get<MyTypeList>(rootUrl).pipe(
map(list => list[locale]),
map(urlList => urlList.map(url => this.http.get<MyType>(url))),
// Looking for a way to transform Observable<Observable<MyType>[]> into Observable<MyType>[]
);
forkJoin(observables).subscribe(/* All items are now available*/)
After the second map
call, I am seeking an elegant solution to convert
Observable<Observable<MyType>[]>
into Observable<MyType>[]
. Any suggestions?