Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiznokes committed Jul 29, 2023
1 parent ba47d22 commit aeb5032
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/proxy/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
this example show how having Proxy could be useful.


the important code part in here:
the important code part are in here:

```
let mut watcher = RecommendedWatcher::new(
Expand All @@ -14,13 +14,13 @@ let mut watcher = RecommendedWatcher::new(
```

notify::RecommendedWatcher have his own runtime to watch event on fs.
`notify::RecommendedWatcher` have his own runtime to watch event on fs.

Currently, the only way to use it in Iced is by using subscription. This is not easy to use and can even lead to issues.

imagine you want to see what files are in a dir, and also be notified when fs events occurs in it.

# with Subscription
### with Subscription
```
sender.send(Action::Watch(path)) // sender is send by using subscription::channel
Expand All @@ -30,7 +30,7 @@ sender.send(Action::Watch(path)) // sender is send by using subscription::channe
fetch_dir(path)
```

# with proxy
### with proxy
```
// we can have the watcher inside our struct
watcher.watch(path)
Expand Down

0 comments on commit aeb5032

Please sign in to comment.