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

.clear types are not correct #16

Closed
moltar opened this issue Sep 24, 2020 · 3 comments
Closed

.clear types are not correct #16

moltar opened this issue Sep 24, 2020 · 3 comments

Comments

@moltar
Copy link

moltar commented Sep 24, 2020

const getClient = pMemoize(function getClient(id: number) {
  return client.getClient(id)
})

//           > error here <
pMemoize.clear(getClient)
Argument of type '(id: number) => Promise<Client>' is not assignable to parameter of type '(...arguments: unknown[]) => unknown'.
  Types of parameters 'id' and 'arguments' are incompatible.
    Type 'unknown' is not assignable to type 'number'.

Thanks

@sindresorhus
Copy link
Owner

Does it work if you change (...arguments: unknown[]) to (...arguments: any[])?

@moltar
Copy link
Author

moltar commented Sep 24, 2020

Yup, it does! :) And that was the quickest reply I've ever had on GH, I think 😁

@moltar
Copy link
Author

moltar commented Sep 24, 2020

Shaa-weet. Thank you 🙏

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

2 participants