-
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
fix ifElse
typings
#162
base: master
Are you sure you want to change the base?
fix ifElse
typings
#162
Conversation
Thanks, looks like I missed the extra params. On the first one you missed the |
I don't think that's applicable to ifElse, consider the following valid usage of const temp = ifElse(
R.nthArg(0),
R.nthArg(1),
R.nthArg(2)
)
temp(true, 'Apples', 1000) Its not possible to capture such arguments — |
Sorry, you're right, unfortunately the spread fails on generics. Otherwise I thought
|
@tycho01 would it really be help to write multiple versions of typings with 1, 2, 3 or 4 params? IMHO its alright to use |
I wouldn't ask you to, but that said, such an overloading strategy is what'd create for the typings with the most powerful inference, actually allowing to check whether the params you provided match up with what the functions want. I'd overlooked the option to use 2+ params, but otherwise that was the intent of the generic in the original. |
I think that's fair. We need to also consider that these arguments are going to be curried. Probably handle that too? PS: Why is the build failing? |
Right, there's currying too. Feel free to either handle or leave it for now. Given that the number of combinations kind of explodes, I've been intending to handle that using code generation, see here. But yeah, I don't mind taking care of that later. P.S.: on the build, I'm aware of it; not all tests are passing yet, some due to issues with TypeScript itself. |
No description provided.