Hey,
I was going through the source code and stumbled upon something pretty weird.
new FileSystemAccess().readText(name, onSuccess, onError)
That's an async interface, but according to https://github.com/NativeScript/NativeScript/blob/5e5d75c09d8a3a49bbf6de5bfa53bc1736e99de4/apps/tests/file-system-access-tests/file-system-access-tests.ts and its use in builder.ts, it works synchronously. That's zalgo right there. A sync interface is handy, but the weird interface is, well, weird. It should return the content of the file on success and throw on error.
Cheers.
Hey,
I was going through the source code and stumbled upon something pretty weird.
That's an async interface, but according to https://github.com/NativeScript/NativeScript/blob/5e5d75c09d8a3a49bbf6de5bfa53bc1736e99de4/apps/tests/file-system-access-tests/file-system-access-tests.ts and its use in
builder.ts, it works synchronously. That's zalgo right there. A sync interface is handy, but the weird interface is, well, weird. It should return the content of the file on success and throw on error.Cheers.