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

138
Views
Making API calls in parallel with the option to have children and get when all are finished to Render

Hello fellow programmers I have this specific case in which I have some trouble thinking of a way to solve my problem.

Let me explain the problem first. We have a JS Object with data to be 'rendered' for each element we need to execute an API call to get its specific attributes. To be perfectly optimized firstly we execute an API call for all elements to be added on the same level ( for instance ) the first level is - add Section, then we see section has children then we execute add all 3 elements on the same level ( adding them together ). But then we see each Element has Child 1 elements that need to be added. And there the fun begins for me because we need to execute an API call for each Element to add its respective Child 1 elements and then check if any of them has more children.

So my problem is when running this all multiple API calls in parallel how can I catch when the last children have been added so I can Execute Render!. I know I can render multiple times but that is not optimized at all ( I tried it and it works ) But I want to use render only 1 time when the last children have been added.

(Note this structure can change we can have 1 level of children or 4 levels.)

So given this structure

  • Section
    • Element
      • Child 1
      • Child 1
        • Child 2
        • Child 2
          • Child 3
    • Element
      • Child 1
        • Child 2
        • Child 2
    • Element
      • Child 1
about 4 years ago · Juan Pablo Isaza
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!