title: How I can pass nested promises to async await
body: <p>I have a function that downloads a file from endpoint using filesaver.js the problem is that I need to pass the function to async await method</p>
  
  <pre><code>fileDownload = () =&gt; {
      fetch('http://localhost:3000/api/buildings/1/assets.xlsx')
          .then(res =&gt; res.blob())
          .then(blob =&gt; saveAs(blob, 'assets.xlsx'))
  }
  </code></pre>
  
  <p>How can change this to async await with this nested promises? (the function is ok)</p>