   (-refresh [this {:keys [repl-env before after state unload-nss load-nss]}]
     (eval-script repl-env
                  (str (call-sym-script before)
-                      (set-ti-state-from-sym-script state)
-                      (unload-nss-script unload-nss)
+                      (unload-nss-script state unload-nss)
                       (load-nss-sync load-nss)
-                      (set-sym-from-ti-state-script state)
                       (call-sym-script after)))))
 
 (defn refresh* [{:keys [refresher

  (swap! tracker assoc ::track/load nil ::track/unload nil)
  (println :ok))

(defn recover-state [repl-env analyzer-env repl-opts state]
  (eval-form repl-env
             analyzer-env
             repl-opts
             `(set! ~state (.-tire_iron_state_ js/goog))))

(defn print-state [repl-env analyzer-env repl-opts]
  (println
    (eval-form repl-env
               analyzer-env
               repl-opts
               `(.-tire_iron_state_ js/goog))))

(defn maybe-quoted->symbol [symbol-or-list]
  (if (list? symbol-or-list)
    (second symbol-or-list)

           "  throw new Error(\"Cannot resolve symbol: " sym "\");\n"
           "}\n"))))

(defn compile-unload-ns [state-sym ns]
  ;; We DO need to guarantee some location won't be cleared. Otherwise we might
  ;; blow away and rebuild their REPL connection.
  (let [ns (comp/munge ns)
        loaded-libs (comp/munge 'cljs.core/*loaded-libs*)]
    (str "(function(){\n"
         "var ns, ns_string, path, key, state_path_parts, on_state_path;\n"
         "ns_string = \"" ns "\";\n"
         "state_path_parts = ["
         (str/join ","
                   (map #(str "\"" % "\"")
                        (object-path-parts (comp/munge state-sym))))
         "];\n"
         "on_state_path = function(k) {\n"
         "  var i, full_name;\n"
         "  full_name = ns_string + '.' + k;\n"
         "  for (i = 0; i < state_path_parts.length; i++) {\n"
         "    if (state_path_parts[i] === full_name) {\n"
         "      return true;"
         "    }\n"
         "  }\n"
         "  return false;\n"
         "}\n;"
         "path = goog.dependencies_.nameToPath[ns_string];\n"
         "goog.object.remove(goog.dependencies_.visited, path);\n"
         "goog.object.remove(goog.dependencies_.written, path);\n"
