use figwheel.client/start API instead of watch-and-reload

This commit is contained in:
Artur Girenko 2017-10-04 22:09:51 +02:00
parent dc31ddfe13
commit 846712cc12
4 changed files with 27 additions and 27 deletions

View File

@ -2,17 +2,17 @@
(:require [om.next :as om]
[$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core]
[$PROJECT_NAME_HYPHENATED$.state :as state]
[figwheel.client :as figwheel :include-macros true]))
[figwheel.client :as fw]))
(enable-console-print!)
(assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?")
(assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?")
(figwheel/watch-and-reload
:websocket-url "ws://localhost:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(om/add-root! state/reconciler core/AppRoot 1))
(fw/start {
:websocket-url "ws://$DEV_HOST$:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(om/add-root! state/reconciler core/AppRoot 1)})
(core/init)

View File

@ -1,9 +1,9 @@
(ns ^:figwheel-no-load env.$PLATFORM$.main
(ns ^:figwheel-no-load env.$PLATFORM$.main
(:require [reagent.core :as r]
[$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core]
[figwheel.client :as figwheel :include-macros true]))
[figwheel.client :as fw]))
(enable-console-print!)
(enable-console-print!)
(assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?")
(assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?")
@ -14,9 +14,9 @@
;; Do not delete, root-el is used by the figwheel-bridge.js
(def root-el (r/as-element [reloader]))
(figwheel/watch-and-reload
:websocket-url "ws://$DEV_HOST$:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(swap! cnt inc))
(fw/start {
:websocket-url "ws://$DEV_HOST$:3449/figwheel-ws"
:heads-up-display false
:jsload-callback #(swap! cnt inc)})
(core/init)

View File

@ -1,10 +1,10 @@
(ns ^:figwheel-no-load env.$PLATFORM$.main
(ns ^:figwheel-no-load env.$PLATFORM$.main
(:require [reagent.core :as r]
[re-frame.core :refer [clear-subscription-cache!]]
[$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core]
[figwheel.client :as figwheel :include-macros true]))
[figwheel.client :as fw]))
(enable-console-print!)
(enable-console-print!)
(assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?")
(assert (exists? core/app-root) "Fatal Error - Your core.cljs file doesn't define an 'app-root' function!!! - Perhaps there was a compilation failure?")
@ -16,12 +16,12 @@
(def root-el (r/as-element [reloader]))
(defn force-reload! []
(clear-subscription-cache!)
(swap! cnt inc))
(clear-subscription-cache!)
(swap! cnt inc))
(figwheel/watch-and-reload
:websocket-url "ws://$DEV_HOST$:3449/figwheel-ws"
:heads-up-display false
:jsload-callback force-reload!)
(fw/start {
:websocket-url "ws://$DEV_HOST$:3449/figwheel-ws"
:heads-up-display false
:jsload-callback force-reload!})
(core/init)

View File

@ -1,6 +1,6 @@
(ns ^:figwheel-no-load env.$PLATFORM$.main
(:require [$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core]
[figwheel.client :as figwheel :include-macros true]))
[figwheel.client :as fw]))
(assert (exists? core/init) "Fatal Error - Your core.cljs file doesn't define an 'init' function!!! - Perhaps there was a compilation failure?")
(assert (exists? core/root-component-factory) "Fatal Error - Your core.cljs file doesn't define an 'root-component-factory' function!!! - Perhaps there was a compilation failure?")
@ -8,11 +8,11 @@
(enable-console-print!)
(figwheel/watch-and-reload
:websocket-url "ws://localhost:3449/figwheel-ws"
:heads-up-display false
;; TODO make this Rum something
:jsload-callback #(#'core/mount-app))
(fw/start {
:websocket-url "ws://$DEV_HOST$:3449/figwheel-ws"
:heads-up-display false
;; TODO make this Rum something
:jsload-callback #(#'core/mount-app)})
(core/init)