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

156
Views
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 answers
Answer question

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 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!