-
Notifications
You must be signed in to change notification settings - Fork 107
feat(query-db-collection): expose query state from QueryObserver #712
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
base: main
Are you sure you want to change the base?
feat(query-db-collection): expose query state from QueryObserver #712
Conversation
Adds new utility methods to QueryCollectionUtils to expose TanStack Query's
QueryObserver state, addressing user request for visibility into sync status:
New utils exposed:
- isFetching() - Check if query is currently fetching (initial or background)
- isRefetching() - Check if query is refetching in background
- isLoading() - Check if query is loading for first time
- dataUpdatedAt() - Get timestamp of last successful data update
- fetchStatus() - Get current fetch status ('fetching' | 'paused' | 'idle')
This allows users to:
- Show loading indicators during background refetches
- Implement "Last updated X minutes ago" UI patterns
- Understand sync behavior beyond just error states
Resolves user request from Discord where status is always 'ready' after
initial load, making it impossible to know if background refetches are happening.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 84.3 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
Adds new utility methods to QueryCollectionUtils to expose TanStack Query's QueryObserver state, addressing user request for visibility into sync status:
New utils exposed:
This allows users to:
Resolves user request from Discord where status is always 'ready' after initial load, making it impossible to know if background refetches are happening.
🤖 Generated with Claude Code
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact