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

  (: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


        watch-dirs
        (->> directories
             (map (fn [^File dir]
                    {:dir dir
                     :watcher (FileWatcher/create dir (vec file-exts))}))
             (into []))]
