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

Possible to get the reverse of pick, like omit #289

Open
wcastand opened this issue Jan 19, 2023 · 1 comment
Open

Possible to get the reverse of pick, like omit #289

wcastand opened this issue Jan 19, 2023 · 1 comment

Comments

@wcastand
Copy link

Was looking for a way to get a partial object by removing some keys. In my case, omit would be 2 keys but pick would be like 20 so it's a lot harder to read and use and means i need to update it everytime i add/remove keys where omit would probably not change until i touch the exact keys which are specific to that function.

const data = {
  name: 'test',
  value: 10,
  isHere: true
}

O.get(O.omit('value'), data) // {name:'test', isHere: true}
@akheron
Copy link
Owner

akheron commented Jan 24, 2023

omit sounds like a useful optic. Would you be interested in implementing 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

No branches or pull requests

2 participants