 (defn watch
   "Given a source directory, produce runnable JavaScript. Watch the source
    directory for changes rebuliding when necessary. Takes the same arguments as
-   cljs.closure/build."
+   cljs.closure/build in addition to :watch-fn, a function of no arguments to
+   run after a successful build."
   ([source opts]
     (watch source opts
       (if-not (nil? env/*compiler*)

                      (seq (.pollEvents key)))
                (println "Change detected, recompiling...")
                (flush)
                (try
                  (buildf)
                  (catch Exception e
                    (.printStackTrace e))))
              (recur key))))))))

(comment

     :output-dir "samples/hello/out"
     :cache-analysis true
     :source-map true
     :verbose true
     :watch-fn
     (fn []
       (println "Success!"))})
  )

;; =============================================================================
