Skip to content

Commit 417ce10

Browse files
committed
Drop debounce, 4.9.3
1 parent e81ea3b commit 417ce10

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Options:
2929
3030
-V, --version output the version number
3131
-c, --config-path [path] load config from [path] (default: cogs.js)
32-
-d, --debounce [seconds] trigger a build at most every [seconds] seconds (default: 0.1)
3332
-w, --watch-paths [path] rebuild if [path] changes, can be specified multiple times
3433
-p, --use-polling use stat polling instead of fsevents when watching
3534
-s, --silent do not output build information, only errors

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cogs",
3-
"version": "4.9.2",
3+
"version": "4.9.3",
44
"type": "module",
55
"author": "Casey Foster <c@sey.me>",
66
"description": "The fast file transform pipeline.",

src/cli.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ program
2323
.version(version)
2424
.description('The fast file transform pipeline.')
2525
.option('-c, --config-path [path]', 'load config from [path]', 'cogs.js')
26-
.option(
27-
'-d, --debounce [seconds]',
28-
'trigger a build at most every [seconds] seconds',
29-
parseFloat,
30-
0.1
31-
)
3226
.option(
3327
'-w, --watch-paths [path]',
3428
'rebuild if [path] changes, can be specified multiple times',

src/run.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import getConfig from './get-config.js';
99

1010
export default async ({
1111
configPath = 'cogs.js',
12-
debounce = 0.1,
1312
onError = _.noop,
1413
onEnd = _.noop,
1514
onResult = _.noop,
@@ -19,7 +18,6 @@ export default async ({
1918
let building = false;
2019
let changedPaths = new Set();
2120
let config;
22-
let timeoutId;
2321

2422
const build = async () => {
2523
if (building) return;
@@ -65,10 +63,7 @@ export default async ({
6563

6664
const handleChangedPath = paths => {
6765
for (const path of paths) changedPaths.add(npath.relative('.', path));
68-
if (!debounce) return tryBuild();
69-
70-
clearTimeout(timeoutId);
71-
timeoutId = setTimeout(tryBuild, debounce * 1000);
66+
tryBuild();
7267
};
7368

7469
const closeWatcher = watch({

0 commit comments

Comments
 (0)