Skip to content

Make applyPatches patched callback async #129

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

Closed
piranna opened this issue Aug 18, 2016 · 1 comment · Fixed by #130
Closed

Make applyPatches patched callback async #129

piranna opened this issue Aug 18, 2016 · 1 comment · Fixed by #130

Comments

@piranna
Copy link
Contributor

piranna commented Aug 18, 2016

On applyPatches() functions the loadFile() option accept a callback that must be called with the content of the file to be patched, but the patched() option don't, forcing to implement it as a sync function. Ironically, just in the next line there's a setTimeout(processIndex, 0) to process the next index!

What I propose is to add a callback argument to patched() function so it can both notify when it has finished and can start processing the next index, and also if there was an error while writting the patch. A more advanced option would be to use async.js for that, that's already a dependency and would make the code a bit cleaner.

@kpdecker
Copy link
Owner

Closing in favor of #130

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

Successfully merging a pull request may close this issue.

2 participants