Skip to content

Conversation

e1himself
Copy link
Contributor

@e1himself e1himself commented Oct 31, 2023

Though this can totally live in the user-land, I thought that it may be a nice addition to the package.

If you think otherwise, feel free to close the PR :)

Thanks!

Copy link
Owner

@y-nk y-nk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm really sorry to see this only now ; truth is i have almost no visitors in here so i rarely go to see PRs 😅 happy to merge after your input on this one feedback.

clearTimeout(timers.get(key))
timers.set(
key,
setTimeout(() => store.del(key), ttl),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setTimeout(() => store.del(key), ttl),
setTimeout(() => { store.del(key); clearTimeout(timers.get(key)) }, ttl),

i think we need to remove the ref of the timer in the timeout otherwise the happy path would keep the timer ref forever. no?

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.

2 participants