title: What are use cases for mergeMap operator?
body: <p>I don't understand the purpose of <code>mergeMap</code> at all. I have heard are two explanations:</p>
  <ol>
  <li>It's like <code>SelectAll()</code> in .NET LINQ - nope.</li>
  <li>It's a combination of RxJS <code>merge</code> and <code>map</code> - nope (or I can't replicate this).</li>
  </ol>
  <p>Consider the <a href="http://jsbin.com/bipogaqepi/1/edit?html,js,console" rel="nofollow noreferrer">following code</a>:</p>
  <pre><code>    var obs1 = new Rx.Observable.interval(1000);
      var obs2 = new Rx.Observable.interval(1000);
      
      //Just a merge and a map, works fine
      obs1.merge(obs2).map(x=&gt; x+'a').subscribe(
        next =&gt; console.log(next)
      )
      
      //Who know what - seems to do the same thing as a plain map on 1 observable
      obs1.mergeMap(val =&gt; Rx.Observable.of(val + `B`))
          .subscribe(
            next =&gt; console.log(next)
          )
  </code></pre>
  <p>The last piece labelled &quot;Who knows what&quot; does nothing more than a map on <code>obs1</code> - what's the point?</p>
  <p>What does <code>mergeMap</code> actually do? What is an example of a valid use case? (Preferably with some code)</p>
  <p>Articles that didn't help me at all (mergeMap code from above is from one of these): <a href="http://reactivex.io/rxjs/class/es6/Observable.js%7EObservable.html#instance-method-mergeMap" rel="nofollow noreferrer">1</a>, <a href="https://www.learnrxjs.io/operators/transformation/mergemap.html" rel="nofollow noreferrer">2</a></p>