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

Arity limitation for R.compose's rightmost function? #452

Open
NicoleRauch opened this issue Mar 1, 2021 · 0 comments
Open

Arity limitation for R.compose's rightmost function? #452

NicoleRauch opened this issue Mar 1, 2021 · 0 comments

Comments

@NicoleRauch
Copy link

I would like to apply @types/ramda to my project but I bumped into an error with R.compose. The documentation claims that

The last argument may have any arity

But looking at the provided typings, the maximum allowed arity is... 3?

I am aware of the comment in the typings:

// generic rest parameters in TS 3.0 allows writing a single variant for any number of Vx
// compose<V extends any[], T1>(fn0: (...args: V) => T1): (...args: V) => T1;
// compose<V extends any[], T1, T2>(fn1: (x: T1) => T2, fn0: (...args: V) => T1): (...args: V) => T2;
// but requiring TS>=3.0 sounds like a breaking change, so just leaving a comment for the future

and I was wondering whether you could reconsider this issue, as TS 3.0 is maybe not such a breaking change any more after all...

(Also, if you make the move to TS 3.0, could I ask you to use unknown[] instead of any[] to make things more type-safe?)

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

No branches or pull requests

1 participant