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

283
Visualizações
Call multiple API using rxjs and return it as obserable

I am having 4 API let be A,B,C,D and I want to get combine data of all 4 API into single obserable.

I want using forkJoin([A,B]) and using the response of forkJoin into forkJoin([C,D]). Example:

return forJoin([a,b]).pipe(map result=>{
 return forkJoin([c(a.result),d(a.result,b.result)]);
})

Problem for is that I am only getting C and D API response. Anyone can help me out.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

First of all there should be a switchMap for returning the inner forkJoin. And if you want to return also the a and b response, you can just use of the original result:

return forkJoin([a,b]).pipe(
  switchMap(result => {
    return forkJoin([c(result[0]),d(result[0], result[1]), of(result)]
  })
})

Now you get an array of all 3 results, last beeing the array of the first response

over 4 years ago · Santiago Trujillo Relatório
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