diff options
Diffstat (limited to 'internal/watcher/watcher.go')
| -rw-r--r-- | internal/watcher/watcher.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/watcher/watcher.go b/internal/watcher/watcher.go index 1ca8e37..ee16b7b 100644 --- a/internal/watcher/watcher.go +++ b/internal/watcher/watcher.go @@ -1,11 +1,20 @@ package watcher +import "time" + type Watcher struct { config Config + + debounce chan struct{} } func New(config Config) *Watcher { + if config.Debounce <= 0 { + config.Debounce = 500 * time.Millisecond + } + return &Watcher{ - config: config, + config: config, + debounce: make(chan struct{}), } } |