You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just starting use with this lib, this is a weird one, I have the following code, which initializes the watcher, given a socketio message:
socket.on('watch', function (msg) {
msg = JSON.parse(msg);
console.log('watch has been received by server', msg);
console.log('paths received by server', msg.paths);
if (watcher) {
console.log('Watched paths before:', watcher.getWatched());
watcher.add(msg.paths);
}
else {
console.log('Watcher initialized.');
watcher = chokidar.watch(msg.paths);
console.log('Newly watched paths:', watcher.getWatched());
}
});
this is what getslogged, not sure what to say
watch has been received by server { paths:
[ '/Users/Olegzandr/WebstormProjects/suman/test/integration-tests/test0.js',
'/Users/Olegzandr/WebstormProjects/suman/test/integration-tests' ] }
paths received by server [ '/Users/Olegzandr/WebstormProjects/suman/test/integration-tests/test0.js',
'/Users/Olegzandr/WebstormProjects/suman/test/integration-tests' ]
Watcher initialized.
Newly watched paths: {} <<<< ???
why might the watched paths object be empty?
The text was updated successfully, but these errors were encountered:
my guess is that we have to wait for the 'add' event to fire, to actually get the list of actively watched paths. I can live with that, and if you don't think this should change, please close :)
perhaps a list of "getRegistered" along with "getWatched", because there is a period whereby a path is registered by the user but getWatched() won't return it yet.
Let me give you a real life example of where a getRegistered call might be useful.
User, registers a path x, but x doesn't exist yet. The user may want to know it is registered, before an add event gets fired. Then the user creates the path x, and chokidar picks it up.
Just starting use with this lib, this is a weird one, I have the following code, which initializes the watcher, given a socketio message:
this is what getslogged, not sure what to say
why might the watched paths object be empty?
The text was updated successfully, but these errors were encountered: