Debouncing watcher tasks with Gulp 4
See original GitHub issueWith Chokidar there’s no debounce option from what I’ve seen and instead it’s up to the user of Chokidar to pass in a debounced function. So currently I do this:
gulp.watch('**/*', _.debounce(compile, 200));
Because lodash doesn’t copy the provided function’s name, my Gulp log says, “[03:06:06] Starting ‘debounced’…” instead of “compile”. The more serious issue is that the logs never say “Finished ‘debounced’…” because the done
callback that gulp.watch
passed to the first invocation of the debounced function is ignored.
So what I’m looking for is an easy and reliable way to debounce gulp.watch
callbacks, possibly by adding debounce support to gulp.watch
itself via the options arg.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:75 (41 by maintainers)
Top Results From Across the Web
Delay gulp-watch execution - Stack Overflow
How can I make the delay to task execution so that when there is more than 1 file changes in a extreme short...
Read more >gulp-debounced-watch - npm Package Health Analysis | Snyk
A gulp watcher with debouncing For more information about how to use this package see README. Latest version published 7 years ago. License:...
Read more >gulp-debounced-watch - npm
A gulp watcher with debouncing. Latest version: 1.0.4, last published: 7 years ago. Start using gulp-debounced-watch in your project by running `npm i ......
Read more >watch() - gulp.js
name type default
ignoreInitial boolean true
delay number 200
queue boolean true
Read more >Gulp chokidar, Gulp-changed, Gulp 4 watch example, Gulp watch ...
gulp -debounced-watch File watcher that uses super-fast chokidar and emits vinyl ... Hi, gulp-watch crashes when deleting files and re-executing a task.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is complete as of https://github.com/gulpjs/gulp/commit/6c03475e1a39d18c139b4d56baa1c14a587f9f4a
Thanks to everyone that helped, tested or gave other insights.
@adambuczynski very soon. Need to firm up vinyl-fs first