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

162
Visualizações
Ionic, Js, React Function Call without callling

Alright, so I have this function:

const savedFile = await Filesystem.writeFile({
  path: fileName,
  data: base64Data,
  directory: Directory.Data,
});

Now the thing that is puzzling me is the fact that the code inside this function is ran even though I don't have a call to it anywhere in my application.

I get this eslint message:

'savedFile' is declared but its value is never read.ts(6133)
'savedFile' is assigned a value but never used.eslint@typescript-eslint/no-unused-vars

Can someone please explain to me how is it tit works in this way and why?

Thanks!

What I assume is the correct way to interpret it is that the savedFile const is only a variable that holds the return value of the async call. Is that correct?

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

This eslint error is telling you that const savedFiles is not being used anywhere else besides the code you provided. If savedFiles is being assigned inside your function is it actually being used anywhere else in that function like return savedfiles Yes savedFiles holds the value returned from the async function call await Filesystem.writeFile()

// savedFiles is declared but not being used or (accessed) for its value
const savedFile = await Filesystem.writeFile({ 
  path: fileName,
  data: base64Data,
  directory: Directory.Data,
});
about 4 years ago · Santiago Gelvez 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