Skip to content

Commit

Permalink
Fix overuse of apply fn in cljs-devtools wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
superstructor committed Jul 27, 2021
1 parent 4eeead1 commit 43072b7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/day8/re_frame_10x/components/cljs_devtools.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,21 @@
;; here as static def.
;; TODO: If we expose ambiance and/or syntax color scheme as settings will need to fix this, maybe by recalculating
;; at the time the setting is changed/loaded.
(def config
(def custom-config
(merge default-config
(base-config :bright :cljs-devtools)
#_bright-ambiance-config))

(defn api-call [api-fn & args]
(with-cljs-devtools-prefs config (apply api-fn args)))
(defn header [value config]
(with-cljs-devtools-prefs custom-config (devtools.formatters.core/header-api-call value config)))

(defn header [& args]
(apply api-call devtools.formatters.core/header-api-call args))
(defn body [value config]
(with-cljs-devtools-prefs custom-config
(devtools.formatters.core/body-api-call value config)))

(defn body [& args]
(apply api-call devtools.formatters.core/body-api-call args))

(defn has-body [& args]
(apply api-call devtools.formatters.core/has-body-api-call args))
(defn has-body [value config]
(with-cljs-devtools-prefs custom-config
(devtools.formatters.core/has-body-api-call value config)))

(defn get-object [jsonml]
(.-object (get jsonml 1)))
Expand Down Expand Up @@ -333,4 +332,4 @@
:child
(if (prn-str-render? data)
(prn-str-render data)
(jsonml->hiccup (header data) (conj path 0)))])
(jsonml->hiccup (header data nil) (conj path 0)))])

0 comments on commit 43072b7

Please sign in to comment.