title: Flattening nested Observables
body: <p>I'm a stuck in nested observable hell and could do with a hand.</p>
  
  <p>I have the following block of code</p>
  
  <pre><code>return this.findUser(term).map( users =&gt; {
    return users.map( user =&gt; this.getLastLogin(user.user_id).map( last_login =&gt; {
      user.last_login = last_login;
      return user;
    }));
  });
  </code></pre>
  
  <p><code>findUser</code> returns <code>Observable&lt;User[]&gt;</code> and <code>getLastLogin</code> returns <code>Observable&lt;number&gt;</code>.</p>
  
  <p>I'm basically hoping to fetch a list of users and then update this with the information from another value.</p>
  
  <p>Right now the code above is returning <code>&lt;Observable&lt;Observable&lt;User&gt;[]&gt;</code>.</p>
  
  <p>I thought I could replace the initial <code>map</code> with <code>flatMap</code> but this turns the object into <code>&lt;Observable&lt;Observable&lt;User&gt;&gt;</code>.</p>
  
  <p>The RxJS documentation is a little hard to decipher so I'm not sure what combination of <code>switch</code>, <code>forkJoin</code> or <code>flatMap</code> will get me to what I need.</p>
  
  <p>I'm hoping to return <code>Observable&lt;User[]&gt;</code>. Could anyone point me in the right direction?</p>