Fork me on GitHub
#lein-figwheel
<
2017-12-08
>
codxse14:12:11

Hi all, nice to meet you. I have some question about installing figwheel with pedestal and system map from component. My code looks like this.

(require '[clojure.tools.namespace.repl :as ns-repl])
(require '[figwheel-sidecar.system :as fw-system])
(require '[com.stuartsierra.component :as component])

(defonce dev-system (atom nil))

(defn init-figwheel []
  (reset! dev-system
    (assoc (app-system/init-dev-system (config))
      :figwheel-system (fw-system/figwheel-system (fw-system/fetch-config))
      :css-watcher (fw-system/css-watcher {:watch-paths ["resources/public/fe/css"]}))))

(defn cljs-repl []
  (fw-system/cljs-repl (:figwheel-system @dev-system)))

(defn start []
  (swap! dev-system component/start-system))

(defn go-cljs []
  (init-figwheel)
  (start))

(defn stop []
  (swap! dev-system component/stop-system))

(defn refresh
  []
  (stop)
  (ns-repl/refresh))
The problem are, everytime I changed the states, the UI refresh to initial page. The second problem when I invoked (refresh) it return error like
#error{:cause "camel-snake-kebab.internals.alter-name",
       :via [{:type clojure.lang.Compiler$CompilerException,
..}
Thank you 🙂