Skip to content

Instantly share code, notes, and snippets.

@houshuang
Created April 22, 2013 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save houshuang/5435378 to your computer and use it in GitHub Desktop.
Save houshuang/5435378 to your computer and use it in GitHub Desktop.
Trying, trying
(defn do-on-change [func files]
(let [old (atom (map-current files))]
(while true
(do
(Thread/sleep 500)
(let [current (atom (map-current files))]
(println "hi")
(if (hash-diff @old @current)
(do
(func)
(swap! old @current))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment