                  :content args})
   args)
 
-(defonce autoload (atom true))
-
-(defn ^:export toggle_autoload []
-  (swap! autoload not))
+(defn autoload? []
+  (condp = (or (.getItem js/localStorage "figwheel_autoload") "true")
+    "true" true
+    "false" false))
+
+(defn ^:export toggle-autoload []
+  (.setItem js/localStorage "figwheel_autoload" (not (autoload?)))
+  (utils/log :info
+             (str "Figwheel autoloading " (if (autoload?) "ON" "OFF"))))
 
 (defn console-print [args]
   (.apply (.-log js/console) js/console (into-array args))

               (let [msg-hist (focus-msgs #{:files-changed :compile-warning} msg-hist')
                     msg-names (map :msg-name msg-hist)
                     msg (first msg-hist)]
                 (when @autoload
                     #_(.log js/console (prn-str msg))
                     (cond
                       (reload-file-state? msg-names opts)
                       (alts! [(reloading/reload-js-files opts msg) (timeout 1000)])
                       
                       (block-reload-file-state? msg-names opts)
                       (.warn js/console "Figwheel: Not loading code with warnings - " (-> msg :files first :file))))
                 (recur))))
    (fn [msg-hist] (put! ch msg-hist) msg-hist)))


          :compile-failed  (on-compile-fail msg)
          nil)))

;; this is seperate for live dev only
(defn heads-up-plugin-msg-handler [opts msg-hist']
  (let [msg-hist (focus-msgs #{:files-changed :compile-warning :compile-failed} msg-hist')
