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

85
Visualizações
lint error related to return in subscription with more than one action

Hello developers I´m subscribing to a service , and on its next() if everytinh is fine , i do expect to do several things, but I´m receiving this lint error:

Unexpected use of comma operator     

the subscription would be kind of:

  someMethod(){
     someService.MySergvice().subscribe(
        ()=>{ return (action1,action2,action3)},
       .....
     )
  }

then i receive this error:Unexpected use of comma operator By the way i did try with this structure:

 someService.MySergvice().subscribe(
        ()=> (action1,action2,action3),
       .....
     )  )
  }

And kept the same How can i improve this situation?

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

0

The comma operator isn't commonly used like this. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator for more details. In this situation, it's completely useless and doesn't make sense.

This is stuff you should be looking for in documentation first.

This may not be doing what you think. It's always returning action3. If you wanted to return an array, use square brackets instead.

 someService.MySergvice().subscribe(
        ()=> [action1, action2, action3],
       .....
     )  )
  }
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