Skip to content

Update CachedQuery to add type to state member#386

Merged
tannerlinsley merged 1 commit intoTanStack:masterfrom
salockhart:cached-query-types
Apr 21, 2020
Merged

Update CachedQuery to add type to state member#386
tannerlinsley merged 1 commit intoTanStack:masterfrom
salockhart:cached-query-types

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
Member

No. The DT types need to be deprecated tbh

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

nx-cloud bot commented Jun 25, 2025

View your CI Pipeline Execution ↗ for commit f24c309

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

☁️ Nx Cloud last updated this comment at 2026-02-18 12:15:38 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

Comments