Skip to content

Commit

Permalink
[#137] Add &args support to swap-config! (@rsslldnphy)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsslldnphy authored and ptaoussanis committed Dec 22, 2015
1 parent ccacc88 commit dca5bb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/taoensso/timbre.cljx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@
(defmacro with-merged-config [config & body]
`(binding [*config* (enc/nested-merge *config* ~config)] ~@body))

(defn swap-config! [f]
#+cljs (set! *config* (f *config*))
#+clj (alter-var-root #'*config* f))
(defn swap-config! [f & args]
#+cljs (set! *config* (apply f *config* args))
#+clj (apply alter-var-root #'*config* f args))

(defn set-config! [m] (swap-config! (fn [_old] m)))
(defn merge-config! [m] (swap-config! (fn [old] (enc/nested-merge old m))))
Expand Down

0 comments on commit dca5bb7

Please sign in to comment.