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: clear cache timeouts #495

Merged
merged 2 commits into from May 17, 2020

Conversation

jackmellis
Copy link
Contributor

calling queryCache.clear() was empting the queries object but not tearing any of them down
this commit adds a clear method to the individual queries, which cancels timeouts and promises
queryCache.clear now loops through the queries and clears each one
I've also update the return type of queryCache.clear as it doesn't actually return anything

I've not added any tests as this is a very intermittent problem and I wasn't entirely sure if I could reliably reproduce the warnings. All existing tests still pass

this should solve #432 and unblock #476

src/queryCache.js Outdated Show resolved Hide resolved
Jack Ellis added 2 commits May 16, 2020 07:26
calling queryCache.clear() was empting the queries object but not tearing any of them down
this commit adds a clear method to the individual queries, which cancels timeouts and promises
queryCache.clear now loops through the queries and clears each one
I've also update the return type of queryCache.clear as it doesn't actually return anything
@tannerlinsley tannerlinsley merged commit f76c860 into TanStack:master May 17, 2020
@tannerlinsley
Copy link
Collaborator

Nice work!

@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 1.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants