basic example
This commit is contained in:
18
src/starter/browser.cljs
Normal file
18
src/starter/browser.cljs
Normal file
@@ -0,0 +1,18 @@
|
||||
(ns starter.browser)
|
||||
|
||||
(defn start []
|
||||
;; start is called by init and after code reloading finishes
|
||||
;; this is controlled by the :after-load in the config
|
||||
(js/console.log "start"))
|
||||
|
||||
(defn ^:export init []
|
||||
;; init is called ONCE when the page loads
|
||||
;; this is called in the index.html and must be exported
|
||||
;; so it is available even in :advanced release builds
|
||||
(js/console.log "init")
|
||||
(start))
|
||||
|
||||
(defn stop []
|
||||
;; stop is called before any code is reloaded
|
||||
;; this is controlled by :before-load in the config
|
||||
(js/console.log "stop"))
|
||||
Reference in New Issue
Block a user