mirror of
https://github.com/status-im/re-frame-10x.git
synced 2025-02-18 17:06:35 +00:00
Introduce with-cljs-devtools-prefs macro
This commit is contained in:
parent
8ce90653dc
commit
77068d3b5d
@ -5,3 +5,13 @@
|
||||
"Reads a file as a string. Slurp is wrapped in a macro so it can interact with local files before clojurescript compilation."
|
||||
[path]
|
||||
(slurp (io/resource path)))
|
||||
|
||||
(defmacro with-cljs-devtools-prefs [prefs & body]
|
||||
`(let [previous-config# (devtools.prefs/get-prefs)
|
||||
prefs# ~prefs]
|
||||
(try
|
||||
(devtools.prefs/set-prefs! prefs#)
|
||||
~@body
|
||||
(finally
|
||||
(assert (= (devtools.prefs/get-prefs) prefs#) "someone modified devtools.prefs behind our back!")
|
||||
(devtools.prefs/set-prefs! previous-config#)))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user