           (recur)))))
 
   ;; shut down watchers when loop ends
-  (doseq [{:keys [watcher]} watch-dirs]
+  (doseq [{:keys [^FileWatcher watcher]} watch-dirs]
     (.close watcher))
 
   ::shutdown-complete)

  (:import (shadow.util FileWatcher)
           (java.io File)))


(defn service? [x]
  (and (map? x)
       (::service x)))

(defn poll-changes [{:keys [dir watcher]}]
  (let [changes (.pollForChanges watcher)]
    (when (seq changes)
      (->> changes

                   :file (io/file dir name)
                   :event event}))
           ;; ignore empty files
           (remove (fn [{:keys [event ^File file] :as x}]
                     (and (not= event :del)
                          (zero? (.length file)))))
           ))))
