              ;; return value of this channel is its last state
              (update state :server dissoc :instance))]
 
-     (assoc state :server-loop server-loop))))
+     (assoc state :server-thread server-thread))))
 
 (def current-instance (atom {}))
 

            [org.httpkit.server :as hk]
            [cljs.compiler :as comp]
            [clojure.edn :as edn]
            [clojure.core.async :as async :refer (go <! >! <!! >!! alt! timeout)]
            [shadow.cljs.repl :as repl]
            [clojure.string :as str]
            [cljs.stacktrace :as st]


         state (assoc state :compiler-state (callback (:compiler-state state) []))
         server-control (get-in state [:server :server-control])
         server-thread
         (thread
           (loop [state state]
               (alt!!
                 server-control
                 ([v]
                   (when-not (nil? v)
