-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathdev.clj
More file actions
50 lines (41 loc) · 1.3 KB
/
dev.clj
File metadata and controls
50 lines (41 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(ns dev
(:require [clojure.pprint :refer [pprint]]
[clojure.tools.namespace.repl :as tn]
[mount.core :as mount :refer [defstate]]
[mount.tools.graph :refer [states-with-deps]]
[app.utils.logging :refer [with-logging-status]]
[app.www]
[app.db :refer [conn]]
[app.example]
[app.nyse :refer [find-orders add-order]])) ;; <<<< replace this your "app" namespace(s) you want to be available at REPL time
(defn start []
(with-logging-status)
(mount/start #'app.conf/config
#'app.db/conn
#'app.www/nyse-app
#'app.example/nrepl)) ;; example on how to start app with certain states
(defn stop []
(mount/stop))
(defn refresh []
(stop)
(tn/refresh))
(defn refresh-all []
(stop)
(tn/refresh-all))
(defn go
"starts all states defined by defstate"
[]
(start)
:ready)
(defn reset
"stops all states defined by defstate, reloads modified source files, and restarts the states"
[]
(stop)
(tn/refresh :after 'dev/go))
(mount/in-clj-mode)
(defn load-data-readers!
"Refresh *data-readers* with readers from newly acquired dependencies."
[]
(#'clojure.core/load-data-readers)
(set! *data-readers* (.getRawRoot #'*data-readers*)))
(load-data-readers!)