-
Notifications
You must be signed in to change notification settings - Fork 22
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
[0.29.9] pluck
inside pipe
get ts error
#107
Comments
Your The problem here is due a combination of two things. First is the fact that typescript always picks the last overload when you pass a function as a prop. And export function reject<A, P extends A>(
pred: (val: A) => val is P,
): {
<B extends A>(list: readonly B[]): Array<Exclude<B, P>>;
<B extends A>(dict: Record<string, B>): Record<string, Exclude<B, P>>;
};
Since most use-cases for The second is how the new The tl;dr is because A short-term fix for you is to not use the curried varieties of those functions, and wrap them with arrow functions in your const extract = R.pipe<[Data[]], (number | null)[], number[]>(
x => R.pluck("value", x),
x => R.reject(R.isNil, x),
); This is far from ideal, but will get around the typing problem until we can release a fix |
Thank you for responding so quickly. I will use the workaround for now. |
The error msg:
Here is a minimal repo to reproduce the error
https://codesandbox.io/p/devbox/vm2hyt?file=%2Fsrc%2Findex.ts%3A7%2C22
I am not sure if my type in
pipe<...>
is wrong but it works in0.29.4
The text was updated successfully, but these errors were encountered: