-
Notifications
You must be signed in to change notification settings - Fork 167
docs: improve incremental updates example in query-collection docs #703
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
docs: improve incremental updates example in query-collection docs #703
Conversation
Replace confusing manual optimistic update pattern with familiar
onInsert/onUpdate handler pattern. Show how to:
- Use persistence handlers (onInsert, onUpdate) like regular collections
- Return { refetch: false } to avoid unnecessary refetches
- Sync server-computed fields using direct writes within handlers
This makes the example more approachable and consistent with the
rest of the documentation.
🤖 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: 83.6 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
Optimistic state is automatically removed when the mutation handler returns, so there's no need to manually delete optimistic items. The handler just needs to write the server response to the synced data store, and when it completes, the optimistic state is automatically replaced. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace confusing manual optimistic update pattern with familiar onInsert/onUpdate handler pattern. Show how to:
This makes the example more approachable and consistent with the rest of the documentation.
🤖 Generated with Claude Code
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact