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

133
Vistas
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
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