Skip to content

Instantly share code, notes, and snippets.

@iku000888
Last active July 11, 2017 22:16
Show Gist options
  • Select an option

  • Save iku000888/4ee170efd5de2d0228d5fdd2970e95cc to your computer and use it in GitHub Desktop.

Select an option

Save iku000888/4ee170efd5de2d0228d5fdd2970e95cc to your computer and use it in GitHub Desktop.

Revisions

  1. iku000888 revised this gist Jul 11, 2017. No changes.
  2. iku000888 created this gist Jul 11, 2017.
    25 changes: 25 additions & 0 deletions file0.cljs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    (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