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

R.once TS type definition miss to context argument and its type #728

Closed
jerome-benoit opened this issue Mar 11, 2024 · 4 comments
Closed

Comments

@jerome-benoit
Copy link

jerome-benoit commented Mar 11, 2024

Describe the bug

Rambda type: export function once<T extends AnyFunction>(func: T): T;

And the expected type is more:

export const once = <T extends AnyFunction, C = unknown>(
  fn: T,
  context?: C
): T

Context(which version of library)
9.1.1

@jerome-benoit jerome-benoit changed the title [BUG] once TS type definition miss to context argument and its tpe [BUG] once() TS type definition miss to context argument and its type Mar 12, 2024
@selfrefactor selfrefactor changed the title [BUG] once() TS type definition miss to context argument and its type R.once TS type definition miss to context argument and its type Mar 18, 2024
@selfrefactor
Copy link
Owner

Not a bug as Rambda typings are same as Ramda. Still, I will add this and it will be released with next version. I will write once it is done.

@jerome-benoit
Copy link
Author

The proposed type definition including the complete once() function arguments is backward compatible with the previous one. Without it, one can't bound it to another instance if using typescript without tsc error, which is a legit use case.

Thanks.

@selfrefactor
Copy link
Owner

txs for clarification; in this case I will add it and release it.

@selfrefactor
Copy link
Owner

Released with 9.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants