-
Notifications
You must be signed in to change notification settings - Fork 59
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
Update Typescript definitions to be more specific #54
base: master
Are you sure you want to change the base?
Update Typescript definitions to be more specific #54
Conversation
EDIT:
Hi! I have been working with this recently. I need to disconnect from Redis when the application shuts down, or else the tests won't finish automatically, and found that the typings are slightly different from what I expected. In this screenshot you can see that, in order to be able to do This is what the code I wrote looks like (I stripped some parts to make it shorter):
|
Are the types in this PR incorrect or is the code snippet example for setting up Nest? Just want to make sure I know what to fix (if anything)! Side note: The double assertion you have in your Nest config ( |
To be honest, I don't know whose responsibility would be to fix that. I'm not sure it belongs on your PR, but maybe the admin of this repo, when looking at this PR, might pick it up. About the double assertion, yes, I am aware of that but it was the only way I found to make it work. This has bitten me back just today, when after updating Sorry for being so unhelpful. :( |
@MikeRossXYZ Just stumbled upon this PR and wanted to let you know that i had to adjust the types as following for my typescript not to complain anymore (uppercase Function, adjusting cb type for reset, keys and ttl methods, and cb of reset being optional. return type of keys)
|
Should fix issue #53 by updating Typescript definitions in a non-breaking way.
Within NestJS, when registering the
CacheModule
, you can configure it as such:In the future, issue #52 should be addressed by updating the function signatures in the code to properly match
Store
. This change is a stop-gap measure to unblock users of NestJS framework (and likely others).