title: RXJS - merge two stream results into one sorted array
body: <p>I have two streams. Let's say:</p>
  <pre><code>const firstStream = Rx.of([
    {
      first: 'first',
    }, {
      third: 'third',
  
    }
  ]);
  
  const secondStream = Rx.of([
    {
      second: 'second'
    }, {
      fourth: 'fourth'
    }
  ]);
  </code></pre>
  <p>Now I want a stream that combines the result of these two streams and maps the result array sorted as follows:</p>
  <pre><code>const resultArr = [
    {
      first: 'first',
    }, 
    {
      second: 'second'
    },
    {
      third: 'third',
    },
    {
      fourth: 'fourth'
    }
  ];
  </code></pre>
  <p>I tried to use <code>combineLatest</code> with RxJS <code>flatmap</code> operator, but that did not work out. I provided a stackblitz playground to test around: <a href="https://stackblitz.com/edit/js-ftxt7o" rel="nofollow noreferrer">StackBlitz</a></p>
  <p>I'm sure there are plenty of ways to do this. Maybe someone can help me out :)</p>