Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.js #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update index.js #4

wants to merge 1 commit into from

Conversation

morulus
Copy link
Collaborator

@morulus morulus commented Jun 24, 2015

Fix problem with duplicate fire in Windows OS. It's about creating variable, that informs about last event. If event type and filename are equals and delay between events is smaller than 20 ms, then event ignored. Tested on Windows 8.

Fix problem with duplicate fire in Windows OS. It's about creating variable, that informs about last event. If event type and filename are equals and delay between events is smaller than 20 ms, then event ignored. Tested on Windows 8.
@jonathanong
Copy link
Contributor

hi sorry for missing this. i'm going to add you as a collaborator and add you on npm since i'd like more maintainers as well

@@ -42,6 +44,9 @@ Watcher.prototype.watch = function (name, files) {
watchers[filename] = watch(filename, {
persistent: true
}, function (event) {
// Catch event clone
if (self.lastFire[0]===event[0]&&self.lastFire[1]===event[1]&&(new Date())-self.lastFire[2]<20) return;
self.lastFire=[event[0],event[1],new Date()];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style tip: need space around operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants