Skip to content

Make applyPatches patched callback async #129

Closed
@piranna

Description

@piranna

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions