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

clearing cache with max age #63

Closed
darkship opened this issue Nov 16, 2023 · 3 comments
Closed

clearing cache with max age #63

darkship opened this issue Nov 16, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@darkship
Copy link

Hello,

I'm using your lib like this:

const memo = nanomemoize(fn, { maxAge: 7_200_000 })

memo()
...
memo.clear()

While calling memo.clear() clears the cache, the setTimeout is not cleared and the process hangs.

@anywhichway
Copy link
Owner

anywhichway commented Nov 16, 2023 via email

@anywhichway
Copy link
Owner

I added the timeout clear and published as 3.0.16. I did not write a unit test to check this (since I am currently out sailing). However, you could test. All existing unit tests pass.

@anywhichway anywhichway self-assigned this Nov 16, 2023
@anywhichway anywhichway added the bug Something isn't working label Nov 16, 2023
@darkship
Copy link
Author

works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants