Skip to content

Commit

Permalink
feat: debounce 1s and watch with awaitWriteFinish
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Jul 30, 2019
1 parent 220b6cf commit 374c94e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ async function connect() {
const queuePackInstall = async (deps) => {
queue.add(async () => packInstall(deps));
};
const debounced = pDebounce(queuePackInstall, 2000, { leading: true });
const debounced = pDebounce(queuePackInstall, 1000, { leading: true });

chokidar
.watch(dep.watch, {
ignored: /node_modules|\.git/,
cwd: dep.path,
// awaitWriteFinish: true,
awaitWriteFinish: {
stabilityThreshold: 1000,
pollInterval: 100
},
ignoreInitial: true
})
.on('ready', () => {
Expand Down

0 comments on commit 374c94e

Please sign in to comment.