Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda