From 6f6d9bd5a8f79a42d3893d179c6eefe734d3f679 Mon Sep 17 00:00:00 2001 From: Elan Shanker Date: Mon, 8 Dec 2014 17:17:31 -0500 Subject: [PATCH] Simplify chokidar event handler --- bin/6to5/file.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/6to5/file.js b/bin/6to5/file.js index 73c0f19a7f..67db8e8264 100644 --- a/bin/6to5/file.js +++ b/bin/6to5/file.js @@ -116,13 +116,9 @@ module.exports = function (commander, filenames) { var watcher = chokidar.watch(filenames, { persistent: true, ignoreInitial: true - }); - - _.each(["add", "change", "unlink"], function (type) { - watcher.on(type, function (filename) { - console.log(type, filename); - walk(); - }); + }).on("all", function (type, filename) { + console.log(type, filename); + walk(); }); } };