Skip to content

Commit fa835be

Browse files
committed
Fixed polling error
Fixed polling error
1 parent c54bf67 commit fa835be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/DirectoryWatcher.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ class DirectoryWatcher extends EventEmitter {
106106
}
107107
}
108108
};
109+
this.watcher.on("change", this.onWatchEvent.bind(this));
109110
} else {
110111
if (IS_OSX) {
111112
this.watchInParentDirectory();
112113
}
113114
this.watcher = watchEventSource.watch(this.path);
114-
this.watcher.on("change", this.onWatchEvent.bind(this));
115115
this.watcher.on("error", this.onWatcherError.bind(this));
116+
this.watcher.on("change", this.onWatchEvent.bind(this));
116117
}
117118
} catch (err) {
118119
this.onWatcherError(err);

0 commit comments

Comments
 (0)