-
Notifications
You must be signed in to change notification settings - Fork 107
fix(collection): fire status:change event before cleaning up event handlers #714
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(collection): fire status:change event before cleaning up event handlers #714
Conversation
…ndlers Event handlers are now cleaned up after the status is changed to 'cleaned-up', allowing status:change listeners to properly detect the cleaned-up state. The cleanup process now: 1. Cleans up sync, state, changes, and indexes 2. Sets status to 'cleaned-up' (fires the event) 3. Finally cleans up event handlers This fixes the collection factory pattern where collections listen for the 'cleaned-up' status to remove themselves from the cache. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 59d67e1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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: +1 B (0%) Total Size: 84.3 kB
ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ![]()
|
🎉 This PR has been released! Thank you for your contribution! |
Event handlers are now cleaned up after the status is changed to 'cleaned-up', allowing status:change listeners to properly detect the cleaned-up state.
The cleanup process now:
This fixes the collection factory pattern where collections listen for the 'cleaned-up' status to remove themselves from the cache.
🤖 Generated with Claude Code
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact