 
 ;; giving this var a uniq name anticipating this library to be
 ;; included with clojure :use, and system could easily clash
-(defonce ^:dynamic *repl-api-system* (atom nil))
+(defonce ^:dynamic *repl-api-system* nil)
 
 #_(def temp-config
   {:figwheel-options {:css-dirs ["resources/public/css"]

  configs of the ids provided."
  [& ids]
  (fs/print-config
   @(get-in @*repl-api-system* [:figwheel-system :system])
   ids))

(defn cljs-repl

  "If you aren't connected to an env where fighweel is running already,
  this method will start the figwheel server with the passed in build info."
  ([{:keys [figwheel-options all-builds build-ids] :as autobuild-options}]
   (when *repl-api-system*
     (alter-var-root #'*repl-api-system* component/stop))
   (alter-var-root #'*repl-api-system* (fn [_] (fs/start-figwheel! autobuild-options))))
  ([]
   (if *repl-api-system*
     (alter-var-root #'*repl-api-system* component/start)
     ;; if no system exists try to read in a configuration
     (start-figwheel! (config/fetch-config)))))

