Skip to content

Update CachedQuery to add type to state member #386

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

Merged
merged 1 commit into from
Apr 21, 2020
Merged

Update CachedQuery to add type to state member #386

merged 1 commit into from
Apr 21, 2020

Conversation

salockhart
Copy link
Contributor

While using the queryCache.refetchQueries method with a predicate, I noticed that the query.state was typed as unknown. This blocks retrieval of the data member of state.

I have added types to the state member, CachedQueryState<T>. I decided to make it generic in order to be able to constrain the type for data - however, it could also be any just as easily.

Should this be backported back to DefinitelyTyped?

@tannerlinsley tannerlinsley merged commit 652567b into TanStack:master Apr 21, 2020
@tannerlinsley
Copy link
Collaborator

No. The DT types need to be deprecated tbh

@salockhart salockhart deleted the cached-query-types branch April 21, 2020 16:28
Copy link

nx-cloud bot commented Jun 25, 2025

View your CI Pipeline Execution ↗ for commit f24c309

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-17 02:04:53 UTC

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