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

fix(types): fetch method should not return void but undefined instead #303

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

Thenkei
Copy link
Contributor

@Thenkei Thenkei commented May 31, 2023

Linked to the issue #302

src/index.ts Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@Thenkei
Copy link
Contributor Author

Thenkei commented May 31, 2023

The test suite is now running correctly locally.

@isaacs
Copy link
Owner

isaacs commented Jun 1, 2023

This patch would allow the fetchMethod to still return void, but I don't think there's any way around the SemVer major LRUCache.fetch type signature change.

isaacs pushed a commit to Thenkei/node-lru-cache that referenced this pull request Jun 6, 2023
PR-URL: isaacs#303
Credit: @Thenkei
Close: isaacs#303
Reviewed-by: @isaacs

EDIT(@isaacs): edited to continue to allow `fetchMethod` to return
`Promise<void>`.

BREAKING CHANGE: public method type signature change
isaacs pushed a commit to Thenkei/node-lru-cache that referenced this pull request Jun 15, 2023
PR-URL: isaacs#303
Credit: @Thenkei
Close: isaacs#303
Reviewed-by: @isaacs

EDIT(@isaacs): updated to preserve `fetchMethod`'s ability to return
`void`.

BREAKING CHANGE: change to public type signature
PR-URL: isaacs#303
Credit: @Thenkei
Close: isaacs#303
Reviewed-by: @isaacs

EDIT(@isaacs): edited to continue to allow `fetchMethod` to return
`Promise<void>`.

BREAKING CHANGE: public method type signature change
@isaacs isaacs merged commit ca4ea17 into isaacs:main Jun 15, 2023
22 checks passed
@Thenkei
Copy link
Contributor Author

Thenkei commented Jun 20, 2023

Thank you so much @isaacs. 🙏

I hope it will help other TS users too.

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

Successfully merging this pull request may close these issues.

None yet

2 participants