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

Support the :-> shorthand #3

Closed
valerauko opened this issue Jun 5, 2023 · 1 comment · Fixed by #5
Closed

Support the :-> shorthand #3

valerauko opened this issue Jun 5, 2023 · 1 comment · Fixed by #5

Comments

@valerauko
Copy link
Contributor

valerauko commented Jun 5, 2023

A very common pattern is to just extract one value from the database, which in re-frame I'd do with :->

(reg-sub
 ::my-value
 :-> :some-keyword)

Writing just :some-keyword results in the subscription returning the parameter vector just like in re-frame, so supporting this syntax would be very helpful.

cf https://github.com/day8/re-frame/blob/dd18854498b6a5e51ed09bfcbd193d9dd84d8381/src/re_frame/core.cljc#L259-L271

I'd be happy to help implementing this

@wkok
Copy link
Collaborator

wkok commented Jun 5, 2023

Interesting, I've never used this syntactic sugar before, but do see its benefit.
You're welcome to submit a PR for it

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 a pull request may close this issue.

2 participants