Skip to content
Source
Sign inSign up
TanStack/db

refactor(db): extract shared live-query adapter helpers (RFC #1623 step 2) #1641

Mergedkevin-dp(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/1641/headmerged by kevin-dp(GitHub profile, opens in a new tab)

Showing 8 changed files with 26 additions and 15 deletions (loading 5).

x
0 of 8 viewed, 8 left
12 additions and 0 deletions.changeset/extract-adapter-helpers.mdAdded
View file
@@ -0,0 +1,12 @@
+---
+'@tanstack/db': minor
+'@tanstack/react-db': patch
+'@tanstack/vue-db': patch
+'@tanstack/svelte-db': patch
+'@tanstack/solid-db': patch
+'@tanstack/angular-db': patch
+---
+​
+Extract shared live-query adapter helpers into `@tanstack/db`
+​
+Adds `isCollection`, `isSingleResultCollection`, and `getLiveQueryStatusFlags` to `@tanstack/db` and migrates all five framework adapters to use them. `isCollection` replaces the per-adapter duck-typing and Solid's `instanceof CollectionImpl` with one structural, multi-realm-safe guard (the `instanceof` form gave false negatives across dual-package boundaries). No behavior change; internal deduplication only.
13 additions and 15 deletionspackages/angular-db/src/index.tsModified
View file
@@ -6,11 +6,15 @@
inject,
signal,
} from '@angular/core'
-import { BaseQueryBuilder, createLiveQueryCollection } from '@tanstack/db'
+import {
+ BaseQueryBuilder,
+ createLiveQueryCollection,
+ isCollection,
+ isSingleResultCollection,