From 11e4b7b009a80f04072b9ae02702893118cf704f Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Tue, 25 Oct 2016 12:12:38 -0500 Subject: [PATCH] turn off debounce/throttle with a negative wait time --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e638668..0fe39fd 100755 --- a/index.js +++ b/index.js @@ -139,8 +139,8 @@ function startWatching(opts) { var chokidarOpts = createChokidarOpts(opts); var watcher = chokidar.watch(opts.patterns, chokidarOpts); - var throttledRun = _.throttle(run, opts.throttle); - var debouncedRun = _.debounce(throttledRun, opts.debounce); + var throttledRun = opts.throttle >= 0 ? _.throttle(run, opts.throttle) : run; + var debouncedRun = opts.debounce >= 0 ? _.debounce(throttledRun, opts.debounce) : throttledRun; watcher.on('all', function(event, path) { var description = EVENT_DESCRIPTIONS[event] + ':';