the event order of chokidar.watch #1450
Unanswered
onehitdragon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
i am writting a folder manager by using electron and react(ui). i listen folder and change state event by event.
but i dont know chokidar will emit event order properly.
example i have folder: a/b/c/d/New document.txt, when i rename d -> dd
chokidar.watch(path.join(__dirname, "abc"), { ignoreInitial: true })
.on('all', (event, path) => {
console.log(event, path);
});
// outputs
unlinkDir C:\Users\Admin\Desktop\code\nodetest\src\abc\New folder\a\b\c\d
addDir C:\Users\Admin\Desktop\code\nodetest\src\abc\New folder\a\b\c\dd
add C:\Users\Admin\Desktop\code\nodetest\src\abc\New folder\a\b\c\dd\New Text Document - Copy.txt
unlink C:\Users\Admin\Desktop\code\nodetest\src\abc\New folder\a\b\c\d\New Text Document - Copy.txt
unlink event be sended finally and result is New Text Document - Copy.txt disappear in state(ui). but i just rename folder.
All reactions