Skip to content

Commit 43f967c

Browse files
authored
Adjust style to es6 🎉
1 parent 8975d8e commit 43f967c

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

lib/Compiler.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Watching {
1919
this.startTime = null;
2020
this.invalid = false;
2121
this.handler = handler;
22-
this.callbacks = [];
22+
this.callbacks = [];
2323
this.closed = false;
2424
if(typeof watchOptions === "number") {
2525
this.watchOptions = {
@@ -106,10 +106,8 @@ class Watching {
106106
if(!this.closed) {
107107
this.watch(compilation.fileDependencies, compilation.contextDependencies, compilation.missingDependencies);
108108
}
109-
this.callbacks.forEach(function(cb) {
110-
cb();
111-
});
112-
this.callbacks.length = 0;
109+
this.callbacks.forEach(cb => cb());
110+
this.callbacks.length = 0;
113111
}
114112

115113
watch(files, dirs, missing) {
@@ -128,9 +126,9 @@ class Watching {
128126
}
129127

130128
invalidate(callback) {
131-
if(callback) {
132-
this.callbacks.push(callback);
133-
}
129+
if(callback) {
130+
this.callbacks.push(callback);
131+
}
134132
if(this.watcher) {
135133
this.pausedWatcher = this.watcher;
136134
this.watcher.pause();

0 commit comments

Comments
 (0)