Update grunt.event.on function signature

Some newcomers as I was, tried to identify the subtask, and didn't know how, even if the *Using the watch event* showed this.
This commit is contained in:
Andrew Luca 2016-09-15 15:49:45 +03:00 committed by GitHub
parent 7f8cf80a6d
commit d40f139501

View File

@ -324,7 +324,7 @@ grunt.initConfig({
}); });
// On watch events configure jshint:all to only run on changed file // On watch events configure jshint:all to only run on changed file
grunt.event.on('watch', function(action, filepath) { grunt.event.on('watch', function(action, filepath, target) {
grunt.config('jshint.all.src', filepath); grunt.config('jshint.all.src', filepath);
}); });
``` ```
@ -339,7 +339,7 @@ var onChange = grunt.util._.debounce(function() {
grunt.config('jshint.all.src', Object.keys(changedFiles)); grunt.config('jshint.all.src', Object.keys(changedFiles));
changedFiles = Object.create(null); changedFiles = Object.create(null);
}, 200); }, 200);
grunt.event.on('watch', function(action, filepath) { grunt.event.on('watch', function(action, filepath, target) {
changedFiles[filepath] = action; changedFiles[filepath] = action;
onChange(); onChange();
}); });