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?
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,
});