title: How to switchmap - emitting an object containing both original and new observable?
body: <p>I want to create an observable which first gets a value from an async function, then use that value to get another value asynchronously, and emit an object containing both values.</p>
  
  <p>Something like:</p>
  
  <pre><code>function getValue1(){
      // asynchronously...
      return Observable.of(value1);
  }
  
  function getValue2UsingValue1(value1){
      // asynchronously...
      // value1 is needed to get value2...
      return Observable.of(value2);
  }
  
  getValue1()
      .switchMap(value1=&gt; getValue2UsingValue1(value1))
      //...
      // I want to get an observable that emits an object containing value1 
      // and value2: {value1: value1, value2: value2}
  </code></pre>
  
  <p>Any help is appreciated.</p>