title: Promise.all is not waiting for the functions to finish
body: <p>Im playing around with some async calls (<code>AXIOS</code> calls) involving promises. The problem with the code is the <code>this.reloadData()</code> gets called before <code>this.updateUsers()</code> and <code>this.updateEmails()</code> executed and finished. What is the right way to wait for the two functions finish, and then call <code>this.reloadData()</code> ?    </p>
  
  <p><code>rest.putEmail</code> and <code>rest.putUser</code> are both <strong>axios</strong> REST API calls.</p>
  
  <pre><code>mainFunc() {
           Promise.all([this.updateUsers(), this.updateEmails()]).then(() =&gt; {
                this.reloadData();
           })
  </code></pre>
  
  <p>}</p>
  
  <pre><code>updateEmails() {
      const {emails} = this.state;
      if (emails.length &gt; 0) {
           emails.map(user =&gt; {
                 rest.putEmail(email.id, email.content)
                     .catch(err =&gt; {this.error(err)});
            });
      }
  }
  
  updateUsers() {
          const {users} = this.state;
          if (users.length &gt; 0) {
               users.map(user =&gt; {
                     rest.putUser(user.id, user.name)
                         .catch(err =&gt; {this.error(err)});
                });
            }
      }
  </code></pre>