shama / gaze

:crystal_ball: A globbing fs.watch wrapper built from the best parts of other fine watch libs.
MIT License
1.15k stars 168 forks source link

event leak #171

Closed gibatronic closed 9 years ago

gibatronic commented 9 years ago

hi! I'm facing some odd behavior with the following code:

var Gaze = require('gaze').Gaze;

var js = new Gaze('*.js');
var md = new Gaze('*.md');

js.on('all', function(event, filepath) {
  console.log('js', event, filepath);
});

md.on('all', function(event, filepath) {
  console.log('md', event, filepath);
});

when I run touch foo.js I get the following output:

js added /Users/gibran_malheiros/Server/vigilia/foo.js
md added /Users/gibran_malheiros/Server/vigilia/foo.js

I was expecting to see only the js one, why the md one is firing? this also happens vice-versa. I'm running OS X 10.10.1 with node 0.10.33 and gaze 0.6.4

shama commented 9 years ago

Sorry this is a known issue with v0.6.x. Please use v0.5.x until I can finish a fix for it. Closing as duplicate of #104.