title: UI freezes whenever I try to send multiple requests to write data into firebase (angular8/node.js)
body: <p>I have an Excel file that I read with xlsx, convert data to json like objects and write in firebase with a loop(for), my write function into firebase returns a promise and with this method my UI freezes whenever I send multiple requests (1k+). I've tried to simulate the same code with async await but I get like 1 iteration per second which is very long if you have 100 000+ data.</p>
  <p>The solution I'm looking for is to push chunks of data into firebase (I tried with 200 rows of data no problem I get everything in like 2 seconds).
  I'm resolving my promise but I fear that it is the one causing memory leaks therefore UI freezes.</p>
  <pre><code>arr = [{key1: value1, key2:value2,...},...,{keyX,:valueX,...,}]
  
  async uploadFb(arr: Array&lt;object&gt;) {
      for (let i = 0; i &lt; arr.length; i++) {
          const element = arr[i];
          console.log(&quot;index is : &quot;, i)
          await this._Service.addAsset(element).then(res =&gt; {
              console.log(res);
          })
      }
  }
  </code></pre>
  <p>and I call my function normally:</p>
  <pre><code>this.uploadFb(arr)
  </code></pre>
  <p>the structure I'm hoping to get in firebase is:</p>
  <p><a href="https://i.stack.imgur.com/JW79J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JW79J.png" alt="for each object in the array" /></a></p>