Skip to content

Instantly share code, notes, and snippets.

@iku000888
Last active July 11, 2017 22:16
Show Gist options
  • Save iku000888/4ee170efd5de2d0228d5fdd2970e95cc to your computer and use it in GitHub Desktop.
Save iku000888/4ee170efd5de2d0228d5fdd2970e95cc to your computer and use it in GitHub Desktop.
(require '[figwheel-sidecar.system :as sys])
(require '[com.stuartsierra.component :as c])
;;fetch-configはfigwheel.ednファイル,もしくはproject.cljの :cljsbuild と :figwheel の内容からfigwheelの設定値を作って返す
(def config (sys/fetch-config))
;;figwheelのStuart Sierraシステム(必要なコンポーネントの依存関係の定義)をvarに束縛する
;;https://github.com/stuartsierra/component
(def system
(c/system-map
:figwheel-system
(sys/figwheel-system config)))
;;varに束縛されているオブジェクトにc/start関数を適用して起動する
(alter-var-root #'system c/start)
;Figwheel: Starting server at http://0.0.0.0:3449
;Figwheel: Watching build - example
;Figwheel: Cleaning build - example
;Compiling "out/fiddles.js" from ["src"]...
;Successfully compiled "out/fiddles.js" in 4.024 seconds.
;;varに束縛されているオブジェクトにc/stop関数を適用して停止する
(alter-var-root #'system c/stop)
;Figwheel: Stopped watching build - example
;Figwheel: Stopping Websocket Server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment