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

distributedOmit with prop tests. did not work for pick so skipping #422

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tommysullivan
Copy link

@tommysullivan tommysullivan commented Jan 17, 2025

fixes #421

u may like to organize this differently and i didnt look into why distributedOmit didnt work for pick, but as i dont use that and really want to use your library but need it to preserve unions for prop() (which returns Omit that breaks unions see #421 ), i built a fix and a type test for it

i looked at effect ts and monocle and had different issues with each, yours seems the most ergonomic and i like the standalone api since i can compose things together independently of the parent types allowing me to avoid repetitive optics

but i need it to work with my unions or i cant use it. about to try incorporating this fork into my app and see how that goes and if i run into any other challenges

really hoping to find a reliable and simple optics capability for typescript

thanks for all the work u put into this

@tommysullivan
Copy link
Author

hm although this fixed some cases for me, i still cant use the library, the .at(n) for an array of T where T is a discriminated union breaks in both the standalone and regular apis, even if i perform the identity during the modification.

will give up and use immer for now, appreciate it nonetheless

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.

Non-Distributive Omit<T,K> used by library breaks discriminated unions, solution included
1 participant