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): queryCache.getQueries #688

Merged
merged 8 commits into from
Jul 2, 2020
Merged

fix(types): queryCache.getQueries #688

merged 8 commits into from
Jul 2, 2020

Conversation

jgettings
Copy link
Contributor

There were some missing types in the getQueries method's type definitions. I copied the parameter types from the other methods that allow AnyQueryKey | string | function, and added boolean as it looks like that's also a possible parameter type, looking at the implementation.

@smashercosmo
Copy link
Contributor

queryKeyOrPredicateFn:
      | AnyQueryKey
      | string
      | boolean
      | ((query: CachedQuery<unknown>) => boolean)

this type should be added to almost all queryCache methods: getQueryData, setQueryData, getQuery, getQueries
make sense to extract it into separate type:

type QueryKeyOrPredicateFn:
      | AnyQueryKey
      | string
      | boolean
      | ((query: CachedQuery<unknown>) => boolean)

@jgettings
Copy link
Contributor Author

@smashercosmo Sounds good! I wasn't sure how far I should go with it. I just pushed an update.

@jgettings
Copy link
Contributor Author

jgettings commented Jul 2, 2020

Sorry about all of the weird extraneous commits, I was just trying to get the checks into a good state, there seems to be a preexisting race condition/timeout/something in a test or two 😢

@MichaelDeBoey MichaelDeBoey merged commit 04a1346 into TanStack:master Jul 2, 2020
@MichaelDeBoey
Copy link
Collaborator

@all-contributors Please add @jgettings for code

@allcontributors
Copy link
Contributor

@MichaelDeBoey

I've put up a pull request to add @jgettings! 🎉

@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 2.4.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jgettings jgettings deleted the getQueries-types branch July 2, 2020 23:54
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.

4 participants