Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Use useQueryCache #36

Merged
merged 3 commits into from
Jun 19, 2020
Merged

Use useQueryCache #36

merged 3 commits into from
Jun 19, 2020

Conversation

Domino987
Copy link
Contributor

Uses useQueryCache instead of the default cache to enable the dev tools if useQuery is used throughout the code base.

This will show now all queries in the dev-tools instead of only the queries not wrapped in a CacheProvider.

Uses useQueryCache instead of the default cache to enable the dev tools if useQuery is used throughout the code base.
@tannerlinsley
Copy link
Owner

This will require a version bump to at least React Query 1.5.0

@Domino987
Copy link
Contributor Author

This will require a version bump to at least React Query 1.5.0

Is that desired or do you want to keep the dev-tools available for all version (1.0.0)?

@tannerlinsley
Copy link
Owner

tannerlinsley commented Jun 18, 2020 via email

@Domino987
Copy link
Contributor Author

Yes that's true. But currently using useQuery cannot be used for the dev tools which is unfortunate.
So are there any concerns regarding bumping the react-query version up and doing a semver bump?

@tannerlinsley
Copy link
Owner

tannerlinsley commented Jun 18, 2020 via email

@Domino987
Copy link
Contributor Author

Is it possible to check if useQuery is exported form react-query (v1.5) and use that. Or else fall back to use the queryCache exported anyway?

@tannerlinsley tannerlinsley merged commit 9ca65b8 into tannerlinsley:master Jun 19, 2020
@stefanprobst
Copy link
Contributor

conditionally calling useQueryCache makes eslint unhappy. also: are we missing queryCache in the dependency array here?

@tannerlinsley
Copy link
Owner

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@tannerlinsley
Copy link
Owner

It may look like a breach of the rules, but it’s legit. If it’s exported, it will always be called. Otherwise, fall back to the global, which since its a global, no need for it to be in the dependency array

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

Successfully merging this pull request may close these issues.

3 participants