Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@tanstack/angular-db@0.1.19

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/db@0.4.14

Patch Changes

  • Fix collection cleanup to fire status:change event with 'cleaned-up' status (#714)

    Previously, when a collection was garbage collected, event handlers were removed before the status was changed to 'cleaned-up'. This prevented listeners from receiving the status:change event, breaking the collection factory pattern where collections listen for cleanup to remove themselves from a cache.

    Now, the cleanup process:

    1. Cleans up sync, state, changes, and indexes
    2. Sets status to 'cleaned-up' (fires the event)
    3. Finally cleans up event handlers

    This enables the collection factory pattern:

    const cache = new Map<string, ReturnType<typeof createCollection>>()
    
    const getTodoCollection = (id: string) => {
      if (!cache.has(id)) {
        const collection = createCollection(/* ... */)
    
        collection.on("status:change", ({ status }) => {
          if (status === "cleaned-up") {
            cache.delete(id) // This now works!
          }
        })
    
        cache.set(id, collection)
      }
      return cache.get(id)!
    }

@tanstack/electric-db-collection@0.1.38

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/query-db-collection@0.2.36

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/react-db@0.1.36

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/rxdb-db-collection@0.1.25

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/solid-db@0.1.36

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/svelte-db@0.1.36

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/trailbase-db-collection@0.1.36

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

@tanstack/vue-db@0.0.69

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14

todos@0.0.15

Patch Changes

  • Updated dependencies [970616b]:
    • @tanstack/db@0.4.14
    • @tanstack/angular-db@0.1.19

@tanstack/db-example-react-todo@0.1.15

Patch Changes

  • Updated dependencies []:
    • @tanstack/electric-db-collection@0.1.38
    • @tanstack/query-db-collection@0.2.36
    • @tanstack/react-db@0.1.36
    • @tanstack/trailbase-db-collection@0.1.36

@KyleAMathews KyleAMathews merged commit ac42951 into main Oct 24, 2025
@KyleAMathews KyleAMathews deleted the changeset-release/main branch October 24, 2025 18:33
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