      :after - A symbol corresponding to a zero-arg client-side function that will be called after refreshing
      :state - A symbol corresponding to a client-side var that holds any state you would like to persisent between refreshes
 
-   All of these values can be overridden in the repl by supplying them to 'refresh.
+   Everything but :source-dirs can be overridden in the repl by supplying them to 'refresh.
+
+   The :state var will not be touched during unloading. However the namespace will
+   be reloaded, so put it in a `defonce`. You must put your repl connection in
+   the state var if you're using a browser repl!
 
    Refresh happens in the following order:
      1. :before is called


   Returns a map of the following fns for use in the cljs repl.

   'refresh: refreshes :source-dirs. Accepts the same args as `special-fns`.
             Any passed args will override the values passed to `special-fns`."
  [& {:keys [source-dirs
             before
             after

  (let [{:keys [::track/unload
                ::track/load]}
        (swap! tracker remove-disabled disable-unload disable-load)]
    (when (seq load)
      (prn :rebuilding)
      ;; build.api does some expensive input checks
      ;; Once we're here, no checks are needed.
      (closure/build (apply build/inputs source-dirs)
                     repl-opts
                     env/*compiler*))
    (when (or (seq unload) (seq load))
      (prn :requesting-reload load)
      (-refresh refresher {:repl-env repl-env
                           :analyzer-env analyzer-env
                           :repl-opts repl-opts
                           :before before
                           :after after
                           :state state
                           :unload-nss unload
                           :load-nss load})))
  (swap! tracker assoc ::track/load nil ::track/unload nil)
  (println :ok))

