Skip to content

Instantly share code, notes, and snippets.

@rodolfo42
Created August 29, 2018 14:27
Show Gist options
  • Save rodolfo42/eb213e433c154413707475cdf8ef7153 to your computer and use it in GitHub Desktop.
Save rodolfo42/eb213e433c154413707475cdf8ef7153 to your computer and use it in GitHub Desktop.
watch files for changes and reload namespaces
(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))))
@rodolfo42
Copy link
Author

needs

[io.pedestal/pedestal.service-tools "0.5.4"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment