-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
toMap should take a mapping function #600
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
Comments
The current functionality is done by design, per the documentation of
So the chaining that you're doing is exactly how they meant it to work, I think 😄. |
Note, the code you have would actually produce:
I'd like a value selector as mentioned above, but I'd actually much prefer a key selector. I find that the lack of a key selector is a much more significant limitation. |
I posted some code for this on #697. Thoughts? |
Closing this aging issue. Trying to shy away from |
It would be nice if
toMap
accepted a mapping function to specify what the values should be:You could do
input.toMap().map(x => x.toUpperCase() + '!')
at the moment but it's not as nice 😜.NET LINQ has similar functionality, except it uses the function to specify the key rather than the value: https://msdn.microsoft.com/en-us/library/bb549277(v=vs.95).aspx
The text was updated successfully, but these errors were encountered: