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: struct util fns #1475

Closed
wants to merge 2 commits into from

Conversation

anthonyjoeseph
Copy link
Contributor

@anthonyjoeseph anthonyjoeseph commented Apr 12, 2021

Closes #1460

Credit to @samhh for omit and pick , @gcanti and @qlonik for everything else.

Note: I was unable to get the function overloading quite right for mapAtE - the existing solution works afaik but it's a bit bloated & ugly

@anthonyjoeseph
Copy link
Contributor Author

anthonyjoeseph commented Apr 12, 2021

Converting to draft until the following are fixed:

  • omit & pick have autocomplete ✅
  • renameAt uses EnsureLiteral

I'll also continue to work on the mapAtE function signature

@anthonyjoeseph anthonyjoeseph marked this pull request as draft April 12, 2021 13:43
@anthonyjoeseph
Copy link
Contributor Author

anthonyjoeseph commented Apr 14, 2021

I've realized that EnsureLiteral is at odds with autocomplete because autocomplete depends on a union of possibilities. So I've used EnsureLiteral for non-piped contexts only. It's a compromise to be sure, but I think it's a good balance of usability & safety

Here's a little example showing the pros/cons of this

@anthonyjoeseph anthonyjoeseph marked this pull request as ready for review April 14, 2021 03:04
@anthonyjoeseph
Copy link
Contributor Author

Closing in favor of spectacles-ts

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

1 participant