Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous file load using the file protocol (file://) #43

Open
gevyaniv opened this issue Jul 19, 2016 · 1 comment
Open

Asynchronous file load using the file protocol (file://) #43

gevyaniv opened this issue Jul 19, 2016 · 1 comment

Comments

@gevyaniv
Copy link

Thank you for taking the time to develop this library.

A small issue I found:
In the _readFile method, the code is checking for status 200 (line 238) in order to resolve the promise.
Some environments, like Cordova iOS, return status 0 as success. See the following post.
Adding (req.status === 200 || req.status === 0) can solve the problem.

It would also be great if you can if you can return the Promise all the way to the initial load of the library. I think is the Typo constructor that calls the readDataFile. This will give the user the option to handle Promise rejections, which are not currently handled by the library.

@kofifus
Copy link

kofifus commented Sep 4, 2016

see promise implementation here #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants