added assertions to provide better feedback when the core namespace contract isn't met

This commit is contained in:
Bruce Hauman 2017-09-22 20:07:17 -04:00
parent 34deb1ba69
commit 54015dbd43
4 changed files with 15 additions and 3 deletions

View File

@ -6,6 +6,9 @@
(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
@ -14,4 +17,4 @@
(core/init)
;; Do not delete, root-el is used by the figwheel-bridge.js
(def root-el (core/app-root))
(def root-el (core/app-root))

View File

@ -5,6 +5,9 @@
(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?")
(def cnt (r/atom 0))
(defn reloader [] @cnt [core/app-root])
@ -16,4 +19,4 @@
:heads-up-display false
:jsload-callback #(swap! cnt inc))
(core/init)
(core/init)

View File

@ -6,6 +6,9 @@
(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?")
(def cnt (r/atom 0))
(defn reloader [] @cnt [core/app-root])
@ -21,4 +24,4 @@
:heads-up-display false
:jsload-callback force-reload!)
(core/init)
(core/init)

View File

@ -2,6 +2,9 @@
(:require [$PROJECT_NAME_HYPHENATED$.$PLATFORM$.core :as core]
[figwheel.client :as figwheel :include-macros true]))
(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?")
(enable-console-print!)
(figwheel/watch-and-reload