Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow args to swap-config! function #137

Merged
merged 1 commit into from
Nov 30, 2015
Merged

Allow args to swap-config! function #137

merged 1 commit into from
Nov 30, 2015

Conversation

rsslldnphy
Copy link
Contributor

This is so trivial it's a bit silly, but this PR allows swap-config! to be passed arguments, following the pattern of clojure.core functions such as swap!, alter-var-root, update etc.

The end result is you can write code like this:

(timbre/swap-config! assoc-in [:appenders :println :enabled?] false)

rather than:

(timbre/swap-config! #(assoc-in % [:appenders :println :enabled?] false))

There aren't any tests for this namespace so I haven't added any for this change, but I've manually tested the function (despite it being very simple) in both Clojure and Clojurescript.

@ptaoussanis
Copy link
Member

Hey Russell, not silly at all- a convenient change, thank you!

ptaoussanis added a commit that referenced this pull request Nov 30, 2015
Add & args to `swap-config!` function (@rsslldnphy)
@ptaoussanis ptaoussanis merged commit 54d7889 into taoensso:master Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants