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

163
Visualizações
Why am I am getting "Cannot find name 'function name' error"?

So I added this function below to my ts class:

 private get(iD: string): Promise <Function> => async () => {
        const tallConfig = await longCrudService.getHalf(iD);
        const stream: Stream = tallConfig.stream;
        const response = this.createUrl(tallConfig, stream);
        return response;
    }

But as soon as I add it, every other functions/Methods below it starts throwing this error: "Cannot find name 'function name'". Did I add it the wrong way?. I'm still trying to get a hold of typescript.

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

0

private get = async (id: string): Promise<Function> => {

or

private get: (iD: string) => Promise<Function> = async (iD: string) => {
about 4 years ago · Juan Pablo Isaza Relatório

0

What you are actually declaring here is a method. Declaring methods with arrow syntax goes like this:

private methodName = (param: ParamType): TypeOfReturnable => {
    // remember to return something of type TypeOfReturnable
}
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