title: How to merge an array of Observables into a single Observable of the same return type
body: <p>What I am trying to achieve is push a few http request observables in an array and then combine all the responses and return with a single observable. </p>
  
  <p>Since all the http requests resolve with the same type 'User', I just want to wait for all of them to resolve and then I can return a single observable with all Users from getUsers() function. </p>
  
  <p>I'm stuck at the <code>return merge(observableRequests)</code> part as I can't get the return type right and I'm not too versed in Rxjs functions.</p>
  
  <p>Here are my three related functions.</p>
  
  <pre><code>    getMyUser(): Observable&lt;User&gt; {
          return this.service.get(`${this._userPath}me`).pipe(
              map((serviceUser: any) =&gt; {
                  return parseUser(serviceUser);
              }));
      }
  
      getUsers(): Observable&lt;User[]&gt; {
          return this.getMyUser()
              .pipe(switchMap((user: User) =&gt; {
                  const activeProvidersIds = this._getActiveProvidersIds(user.providers);
                  const observableRequests = activeProvidersIds.map((id: number) =&gt; this.getUserRequest(id));
                  return merge(observableRequests);
              }));
      }
  
      getUserRequest(facDbk: number): Observable&lt;User[]&gt; {
          return this.service.get(`${this._providerPath}${facDbk}/users`).pipe(
              map((serviceUsers: any) =&gt; {
                  return parseUsers(serviceUsers);
              })
          );
      }
  </code></pre>
  
  <p>Any help is appreciated.</p>