-
Notifications
You must be signed in to change notification settings - Fork 64
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
preserving keys (+ types by key) while mapping over objects (R.mapObjIndexed, R.map) #110
Comments
Update: so it looks like it should be possible; thanks to the helpful community at the TypeScript repo for helping point that out. function mapObject<K extends string | number, T, U>(obj: Record<K, T>, f: (x: T) => U): Record<K, U>; My current confusion is w.r.t. how I might be able to reapply constructs like the |
Made a PR for this here now. |
I think |
Yeah, I'm under the impression it's pretty new. That said, I imagine there shouldn't be too many downsides to upgrading... |
This can be supported once |
@blakeembrey: Yeah, basic support (preserving keys) is possible with |
Sounds great. I just found the thread because I was using |
This is mostly blocked by microsoft/TypeScript#6606, will retry after. |
AFAICT, TS currently doesn't support this. I'd like to leave this as a place-holder for when they would start supporting this though. I think currently this is my main gripe about using Ramda with TS.
Edit: linked issue
The text was updated successfully, but these errors were encountered: