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

Options for default-value-transformer #278

Merged
merged 2 commits into from Oct 13, 2020

Conversation

ikitommi
Copy link
Member

  • malli.transform/default-value-transformer accepts options :key and :defaults:
(m/decode
  [:map
   [:user [:map
           [:name :string]
           [:desciption {:ui/default "-"} :string]]]]
  nil
  (mt/default-value-transformer
    {:key :ui/default
     :defaults {:map (constantly {})
                :string (constantly "")}}))
; => {:user {:name "", :desciption "-"}}

@ikitommi ikitommi merged commit d3f9605 into master Oct 13, 2020
@ikitommi ikitommi added the Clojurists Together Sponsored by Clojurists Together Q3 2020 label Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clojurists Together Sponsored by Clojurists Together Q3 2020
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant