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

Add metadata on destructure for symbols #1113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pfeodrippe
Copy link

@pfeodrippe pfeodrippe commented Oct 11, 2024

With this, we can make all the keys in mx/defn required and we can pass, for example, ^:optional to one symbol.

So we can use like this

(mx/defn ^:malli/required-keys eita
  [{:keys [a/b
           ^:optional a/c
           a/d]}]
  ...)

(eita {:a/b 120 :a/d 40})               ;; This would then work without :a/c being required.

Will add tests if we are okay with it \o

With this, we can make all the keys in `mx/defn` required and
we can pass, for example, ^:optional to one symbol.

So we can use like this

```clojure
(mx/defn ^:malli/required-keys eita
  [{:keys [a/b
           ^:optional a/c
           a/d]}]
  ...)

(eita {:a/b 120 :a/d 40})               ;; This would then work.
```

Will add tests if we are okay with it \o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant