New creates a Watcher that monitors dir for markdown file changes.
(dir string, onChange func(), debounce time.Duration)
| 22 | |
| 23 | // New creates a Watcher that monitors dir for markdown file changes. |
| 24 | func New(dir string, onChange func(), debounce time.Duration) *Watcher { |
| 25 | return &Watcher{ |
| 26 | dir: dir, |
| 27 | onChange: onChange, |
| 28 | debounce: debounce, |
| 29 | done: make(chan struct{}), |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // Start begins watching. It blocks until Stop is called or an error occurs. |
| 34 | // |
no outgoing calls