Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/nextjournal/beholder.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns nextjournal.beholder
(:import [io.methvin.watcher DirectoryChangeEvent DirectoryChangeEvent$EventType
DirectoryChangeListener DirectoryWatcher]
[io.methvin.watcher.hashing FileHasher]
[java.nio.file Paths]))

(defn- fn->listener ^DirectoryChangeListener [f]
Expand All @@ -24,6 +25,7 @@
Not meant to be called directly but use `watch` or `watch-blocking` instead."
[cb paths]
(-> (DirectoryWatcher/builder)
(.fileHasher FileHasher/LAST_MODIFIED_TIME)
(.paths (map to-path paths))
(.listener (fn->listener cb))
(.build)))
Expand Down