-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add :default/fn prop for default-value-transformer
use case: we want the default value to be current time. previously you would have to do something like this: ``` (m/decode [:time/instant {:default :now}] nil (mt/default-value-transformer {:default-fn (fn [_ x ] (case x :now (java.time.Instant/now) x))})) ``` this patch lets you declare this without the indirection: ``` (m/decode [:time/instant {:default/fn #(java.time.Instant/now)}] nil mt/default-value-transformer) ```
- Loading branch information
1 parent
8f30b58
commit fa74555
Showing
2 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters