Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!