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

Draft: New: lensIso #3465

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Harris-Miller
Copy link
Contributor

I found myself having to implement this on my own recently in a project at work. It's useful to have alongside lens and has a distinct implementation that isn't a simple composition of other functions. So figured it was worth adding to the core lib

TODO:

  • Unit tests

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (929ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (943ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

@Harris-Miller Harris-Miller changed the title Draf: New: lensIso Draft: New: lensIso May 2, 2024
Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (870ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

Copy link

github-actions bot commented May 2, 2024

Coverage
> ramda@0.30.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1190 passing (888ms)


=============================== Coverage summary ===============================
Statements   : 94.04% ( 2477/2634 )
Branches     : 85.73% ( 967/1128 )
Functions    : 93.25% ( 553/593 )
Lines        : 94.32% ( 2323/2463 )
================================================================================

@Harris-Miller
Copy link
Contributor Author

@kedashoe @CrossEye was hoping to get feedback on accepting the proposal to add this function before I put in the effort of writing unit tests. Thanks in advance

@kedashoe
Copy link
Contributor

Can achieve the same with lens(getter, unary(setter))? Do you have an example that works differently from lens? I think the example in the docstring works out to the same thing lens vs lensIso.

@Harris-Miller
Copy link
Contributor Author

I didn't think to use unary() when I did this at my job. And to my surprise, the typings worked out as you'd expect it to with lens(getter, unary(setter))

Ref: https://tsplay.dev/WP2BJN

The only reason I can see keeping this then would be for convenience and exposure. I can adjust the file to use lens(getter, unary(setter)) as well to cut down on duplicate code. Let me know

@kedashoe
Copy link
Contributor

We have https://github.com/ramda/ramda-lens which feels like where it belongs. But of course that hasn't been updated in many years. I reckon mull it over for a bit and if you want to bring it in or others chime that they'd like it we can work to get it in.

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 this pull request may close these issues.

None yet

2 participants