github TanStack/db @tanstack/db@0.0.7

latest releases: @tanstack/vue-db@0.0.48, @tanstack/trailbase-db-collection@0.1.15, @tanstack/svelte-db@0.1.15...
3 months ago

Patch Changes

  • Expose utilities on collection instances (#161)

    Implemented a utility exposure pattern for TanStack DB collections that allows utility functions to be passed as part of collection options and exposes them under a .utils namespace, with full TypeScript typing.

    • Refactored createCollection in packages/db/src/collection.ts to accept options with utilities directly
    • Added utils property to CollectionImpl
    • Added TypeScript types for utility functions and utility records
    • Changed Collection from a class to a type, updating all usages to use createCollection() instead
    • Updated Electric/Query implementations
    • Utilities are now ergonomically accessible under .utils
    • Full TypeScript typing is preserved for both collection data and utilities
    • API is clean and straightforward - users can call createCollection(optionsCreator(config)) directly
    • Zero-boilerplate TypeScript pattern that infers utility types automatically

Don't miss a new db release

NewReleases is sending notifications on new releases.