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

feat(optics): collect and transform #30

Merged
merged 2 commits into from
Oct 1, 2020
Merged

feat(optics): collect and transform #30

merged 2 commits into from
Oct 1, 2020

Conversation

serras
Copy link
Collaborator

@serras serras commented Oct 1, 2020

Applicative-style programming for optics!

optic(
  collect({ first: optic('firstName'), last: optic('lastName')}),
  transform(x => x.first + ' ' + x.last)
).view({ first: 'Alex', last: 'Smith' }) // 'Alex Smith'

@serras serras added the enhancement New feature or request label Oct 1, 2020
@serras serras requested a review from kutyel October 1, 2020 19:02
@serras serras self-assigned this Oct 1, 2020
Copy link
Owner

@kutyel kutyel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kutyel kutyel merged commit b4b6b69 into master Oct 1, 2020
@kutyel kutyel deleted the collect-transform branch October 1, 2020 21:08
@github-actions
Copy link

github-actions bot commented Oct 1, 2020

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants