Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
How do I make multiple async calls in Javascript to update my UI without blocking?

I have several dropdownlists on a web page that retrieve their contents via api call to the server, which are all very quick, and an additional call that retrieves 1000 rows from the database - considerably longer response time. I have this Javascript/Vue code that runs when everything is loaded and ready to go:

setOrderStatuses: async function () {
    ...
},
setSpecialOrders: async function () {
    ...
},
setSubmitterNames: async function () {
    ...
},
...
mounted: function () {
   this.$nextTick(async function () {
      return await Promise.all([
         this.setOrderStatuses(),
         this.setSpecialOrders(),
         this.setSubmitterNames()
      ]);
   });
},

...wherein everything retrieves data as expected, but the UI doesn't update until all of the promises are fulfilled. If I put a breakpoint on the server that blocks the answer to setOrderStatuses(), for instance, neither of the other methods update the UI until I click continue and the promise is filled.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

jus make your mouted method async like :

async mounted () {
   await this.setOrderStatuses()
   await this.setSpecialOrders()
   await this.setSubmitterNames()
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!