title: Rxjs: add data to elements of array returned from http response
body: <p>Following this question: <a href="https://stackoverflow.com/questions/35937491/add-data-to-http-response-using-rxjs">Add data to http response using rxjs</a></p>
  
  <p>I've tried to adapt this code to my use case where the result of the first http call yields an array instead of a value... but I can't get my head around it.
  How do I write in rxjs (Typescript) the following pseudo code?</p>
  
  <p>call my server</p>
  
  <p>obtain an array of objects with the following properties: (external id, name)</p>
  
  <p>for each object, call another server passing the external id</p>
  
  <p>for each response from the external server, obtain another object and merge some of its properties into the object from my server with the same id</p>
  
  <p>finally, subscribe and obtain an array of augmented objects with the following structure: (external id, name, augmented prop1, augmented prop2, ...)</p>
  
  <p>So far the only thing I was able to do is:</p>
  
  <pre><code>    this._appService
          .getUserGames()
          .subscribe(games =&gt; {
              this._userGames = _.map(games, game =&gt; ({ id: game.id, externalGameId: game.externalGameId, name: game.name }));
              _.forEach(this._userGames, game =&gt; {
                  this._externalService
                      .getExternalGameById(game.externalGameId)
                      .subscribe(externalThing =&gt; {
                          (&lt;any&gt;game).thumbnail = externalThing.thumbnail;
                          (&lt;any&gt;game).name = externalThing.name;
                      });
              });
          });
  </code></pre>
  
  <p>Thanks in advance</p>