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

regards: collect-one #188

Closed
JoePython1 opened this issue Mar 8, 2017 · 1 comment
Closed

regards: collect-one #188

JoePython1 opened this issue Mar 8, 2017 · 1 comment
Labels

Comments

@JoePython1
Copy link

I have a list of maps.

Currently I use the following pattern

(select [ALL
            (collect-one :a)
            (collect-one :b)
            (collect-one :c)
           :d ]
           input)

Although the above solution works, It looks verbose.
Is there a navigator which can collect all three keys (:a, :b :c) instead of three instances of collect-one's

@nathanmarz
Copy link
Collaborator

You can do:

(select [ALL ((eachnav collect-one) :a :b :c) :d] input)

You can do (def multi-collect-one (eachnav collect-one)) to make it reusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants