-
Notifications
You must be signed in to change notification settings - Fork 102
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
Ability to choose which input param to pass to a func #401
Comments
This is how Ramda implemented it |
I keep seeing this issue thinking that you’re talking about a placeholder. Can’t you just use nthArg from Ramda? |
Quite possibly but while for some it's common to use Ramda many people don't use it in conjunction with crocks. It's a bad habit to just grab all the libraries for the sake of a few functions and so if it would be valuable within the library it gets put forward as a discussion point. Other than "it's already in Ramda" do you see a major issue with it? |
TBH, It is my opinion that writing the in place function could read a bit better, because you can provide the name of the argument you are trying to capture and can see the "shape" of the function. That is the reason I am opposed to adding placeholders to crocks. Puts an undue cognitive burden, in my opinion, on anyone else (including future me) that has to parse and maintain it. This could also open a can of "well what if I want the second and third". I can say the same thing with this. BUT unlike placeholders, I am not totes opposed personally, if this gets support I do not see why this would be bad thing (other than possible additional cognitive load). Although we may wanna come up with a better name (says the person with no good examples of what that should be). |
No issue with nthArg specifically. I suppose it's a difficult philosophical problem for library authors to decide just exactly where to draw these lines regarding compatibility/duplication with/of other libraries. I will say that if Crocks is meant to completely supplant a utility library like Ramda, then it has a lot of missing functionality. It may serve to make a list of all the functions Ramda provides, separating the functions that should return an ADT, e.g., Speaking personally, I came looking into Crocks, Folktale, Sanctuary and others because Ramda does not provide Maybe and Either - simple as that. All of the functions that should return a Maybe can return |
closing for now till we find enough requests to validate adding it to the library |
Is your feature request related to a problem? Please describe.
Yes, their are some frameworks where the event handlers pass the instance of the component as the first param.
Describe the solution you'd like
I'd like to see a function i could use to choose which param to take and pass to a containing func
Describe alternatives for how you do this now
I write in place funcs
(_, a) => f(a)
Code
The text was updated successfully, but these errors were encountered: