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

108
Visualizações
Add find inside pipe

I have the following code :

await this.panelService.getActivePanels().subscribe(activePanels => {
      panel = activePanels.find(panel => panel.serviceId === serviceId);
    });

I want to add a pipe before the subscribe, that does the find operation, so when I subscribe I will get just the one panel returned by the find, is that possible? and how would it look?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

What you are looking for is called map and you can use it like this:

this.panelService.getActivePanels().pipe(
  map(activePanels => activePanels.find(panel => panel.serviceId === serviceId))
).subscribe(panel => {
  console.log(panel);
});
about 4 years ago · Juan Pablo Isaza 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