title: rxjs use async/await in map Rx.Observable.range(1, 5).map
body: <p>I want get a list from rxjs using async/await. What should I do?</p>
  
  <pre><code>function getData(num){
      return new Promise((resolve, reject)=&gt;{
          resolve(num + 1)
      })
  }
  
  async function create(){
      var list = await Rx.Observable.range(1, 5).map(async (num)=&gt;{
          const data = await getData(num)
          return  data
      }).toArray().toPromise()
  
      return list
  }
  
  
  Rx.Observable.fromPromise(create()).subscribe(list=&gt;{
      console.log(list)
  }, err=&gt;{
      console.log(err)
  })
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>[ Promise { 2 },
    Promise { 3 },
    Promise { 4 },
    Promise { 5 },
    Promise { 6 } ]
  </code></pre>
  
  <p>I want get data like this</p>
  
  <pre><code>[2,3,4,5,6]
  </code></pre>