Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda