Created
August 29, 2018 14:27
-
-
Save rodolfo42/eb213e433c154413707475cdf8ef7153 to your computer and use it in GitHub Desktop.
watch files for changes and reload namespaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[io.pedestal.service-tools.dev :as dev-tools]) | |
(def ^:private watcher (atom nil)) | |
(defn stop-watching [] | |
(let [stop @watcher] | |
(when (fn? stop) (stop) (reset! watcher nil)))) | |
(defn watch | |
([] (watch ["src/"])) | |
([folders] | |
(stop-watching) | |
(reset! watcher (dev-tools/watch folders)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
needs