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

How to close DirectoryWatcher #142

Open
realth000 opened this issue Apr 6, 2023 · 2 comments
Open

How to close DirectoryWatcher #142

realth000 opened this issue Apr 6, 2023 · 2 comments

Comments

@realth000
Copy link

Hi!

I'm using watcher: ^1.0.2 and I wonder how to close a DirectoryWatcher?

The close method in the source code can not be used on a DirectoryWatcher object.

2023-04-06_23-07

Also there's no method mentioned in the official document.

@mudlee
Copy link

mudlee commented May 22, 2023

Would be nice to know this here too... :)

@dipin-arora
Copy link

 var watcher = DirectoryWatcher(directory);
 StreamSubscription subscription = watcher.events.listen((event) {
    // do stuff
 });
 subscription.cancel();

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

No branches or pull requests

3 participants