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
Fix issue with onDidChange
not always being called
#143
Conversation
Great work @nhevia! Really need this to fix sindresorhus/electron-store#93. @sindresorhus can we please get this in ASAP? |
So |
Also please open an issue on Node.js. I want to ensure the issue will be eventually fixed in Node.js. |
I'm seeing #108 on macOS. |
Ok, so let's use |
you mean |
Yes |
Changes added. Tests were failing, added to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wicked 👍
Thanks for the quick turn around on this @nhevia! |
The PR title is outdated. |
Will you have time to address the feedback @nhevia? |
@nhevia Bump |
Tests passing. Feel free to squash this mess 👀 |
onDidChange
not always being called
Fixes #108 and fixes sindresorhus/electron-store#93
Adds a configuration option called
watchFile
.Works exactly like
watch
but usesfs.watchFile
instead offs.watch
, allowing the subscription to read changes in the file more than once.Clearly slower (sometimes, benchmarking is unreliable 100/2000ms) than
watch
but the only way to truly watch a file in React (and possible other scenarios, but not tested).