floatdrop/gulp-batch — pull request #7 by sakana (2014-11-02 04:26:23+00:00)
Title: Fix concurrent callback calls

Currently, gulp-batch will call the callback more than once concurrently if it gets an event while running the callback. This is because the module-level `holdOn` variable is *not* correctly set to true (the `var holdOn = ...` should just be `holdOn = ...`)!

Only removing the extraneous `var` would cause gulp-batch to completely ignore events while the callback is running, which is undesirable. This patch stores events that occur during the callback, and - if any occurred - waits for the timeout interval after the callback ends and flushes them.