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

157
Vistas
Manipulating API in Vue methods

I have a method that is making 2 API calls simultaneously. How can I take the results of the API calls and manipulate them in another method within the same Vue component.

 buildChart(){
    *method where calls would be manipulated"

}
     async updateChart() {
        this.isLoading = true;
        const apiCall1 = await get().then((result) => {
          console.log(result);
          this.isLoading = false;
        });
        const apiCall2= await get().then((result) => {
          console.log(result);
          this.isLoading = false;
        });
      }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use Promise.all to execute the two requests in parallel, the result will be an array of two items of each async request.

async buildChart(){
  // here result will be an array with two items of the result of each async get method.
  const [firstRequest, secondRequest] = await updateChart()
  this.isLoading = false;
},
updateChart() {
  this.isLoading = true;
  return Promise.all([get(), get()])
}

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