Skip to content

Commit

Permalink
Revert "Add debounce option to node api, 0.9.2", 0.9.3
Browse files Browse the repository at this point in the history
This reverts commit 8c150de.
  • Loading branch information
caseywebdev committed Feb 16, 2018
1 parent 8c150de commit 6bba7bd
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Changelog

## 0.9.2
- Add `debounce` to node API.

## 0.9.1
- Fix package.json `main` entry.

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ As of `0.9.0` watchy exposes a Node.js API.
const watchy = require('watchy');

watchy({
debounce: 1, // defaults to 0, time in seconds to wait after the last change before firing the callback
patterns: ['js/**/*.js', 'css/**/*.css'],
onError: error => console.error(error),
onChange: ({action, path}) => console.log(action, path),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "watchy",
"version": "0.9.2",
"version": "0.9.3",
"author": "Casey Foster <c@sey.me>",
"license": "MIT",
"main": "src",
Expand Down
3 changes: 0 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const cleanDirs = dirs => {
};

module.exports = async ({
debounce,
onChange = _.noop,
onError = _.noop,
patterns = [],
Expand All @@ -31,8 +30,6 @@ module.exports = async ({
patterns = patterns.map(pattern => npath.resolve(pattern));
const dirs = cleanDirs(patterns.map(getDir));

if (debounce) onChange = _.debounce(onChange, debounce * 1000);

const handler = changes => {
changes.forEach(({action, kind, path}) => {
if (kind !== 'file') return;
Expand Down
3 changes: 1 addition & 2 deletions src/run-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ module.exports = () => {

if (watch) {
watchy({
debounce,
onChange: run,
onChange: debounce ? _.debounce(run, debounce * 1000) : run,
onError: handleError,
patterns: watch,
usePolling
Expand Down

0 comments on commit 6bba7bd

Please sign in to comment.