diff --git a/docs/framework/angular/reference/functions/injectLiveQuery.md b/docs/framework/angular/reference/functions/injectLiveQuery.md index de1cc01f75..0bb18bb03e 100644 --- a/docs/framework/angular/reference/functions/injectLiveQuery.md +++ b/docs/framework/angular/reference/functions/injectLiveQuery.md @@ -9,7 +9,7 @@ title: injectLiveQuery function injectLiveQuery(options): InjectLiveQueryResult; ``` -Defined in: [index.ts:118](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L118) +Defined in: [index.ts:119](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L119) ### Type Parameters @@ -43,7 +43,7 @@ Defined in: [index.ts:118](https://github.com/TanStack/db/blob/main/packages/ang function injectLiveQuery(options): InjectConditionalLiveQueryResult; ``` -Defined in: [index.ts:128](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L128) +Defined in: [index.ts:129](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L129) ### Type Parameters @@ -77,7 +77,7 @@ Defined in: [index.ts:128](https://github.com/TanStack/db/blob/main/packages/ang function injectLiveQuery(queryFn): InjectLiveQueryResult; ``` -Defined in: [index.ts:138](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L138) +Defined in: [index.ts:139](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L139) ### Type Parameters @@ -101,7 +101,7 @@ Defined in: [index.ts:138](https://github.com/TanStack/db/blob/main/packages/ang function injectLiveQuery(queryFn): InjectConditionalLiveQueryResult; ``` -Defined in: [index.ts:141](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L141) +Defined in: [index.ts:142](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L142) ### Type Parameters @@ -125,7 +125,7 @@ Defined in: [index.ts:141](https://github.com/TanStack/db/blob/main/packages/ang function injectLiveQuery(config): InjectLiveQueryResult; ``` -Defined in: [index.ts:146](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L146) +Defined in: [index.ts:147](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L147) ### Type Parameters @@ -149,7 +149,7 @@ Defined in: [index.ts:146](https://github.com/TanStack/db/blob/main/packages/ang function injectLiveQuery(liveQueryCollection): InjectLiveQueryResultWithCollection; ``` -Defined in: [index.ts:150](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L150) +Defined in: [index.ts:151](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L151) ### Type Parameters @@ -181,7 +181,7 @@ Defined in: [index.ts:150](https://github.com/TanStack/db/blob/main/packages/ang function injectLiveQuery(liveQueryCollection): InjectLiveQueryResultWithSingleResultCollection; ``` -Defined in: [index.ts:158](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L158) +Defined in: [index.ts:159](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L159) ### Type Parameters diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md index 9b92145d7c..a9ffbe32b2 100644 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md +++ b/docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md @@ -3,7 +3,7 @@ id: InjectLiveQueryResult title: InjectLiveQueryResult --- -Defined in: [index.ts:40](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L40) +Defined in: [index.ts:41](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L41) The result of calling `injectLiveQuery`. Contains reactive signals for the query state and data. @@ -25,7 +25,7 @@ collection: Signal< | null>; ``` -Defined in: [index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46) +Defined in: [index.ts:47](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L47) A signal containing the underlying collection instance (null for disabled queries) @@ -37,7 +37,7 @@ A signal containing the underlying collection instance (null for disabled querie data: Signal>; ``` -Defined in: [index.ts:44](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L44) +Defined in: [index.ts:45](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L45) A signal containing the results as an array, or single result for findOne queries @@ -49,7 +49,7 @@ A signal containing the results as an array, or single result for findOne querie isCleanedUp: Signal; ``` -Defined in: [index.ts:65](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L65) +Defined in: [index.ts:66](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L66) A signal indicating whether the collection has been cleaned up @@ -61,7 +61,7 @@ A signal indicating whether the collection has been cleaned up isError: Signal; ``` -Defined in: [index.ts:63](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L63) +Defined in: [index.ts:64](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L64) A signal indicating whether the collection has an error @@ -73,7 +73,7 @@ A signal indicating whether the collection has an error isIdle: Signal; ``` -Defined in: [index.ts:61](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L61) +Defined in: [index.ts:62](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L62) A signal indicating whether the collection is idle @@ -85,7 +85,7 @@ A signal indicating whether the collection is idle isLoading: Signal; ``` -Defined in: [index.ts:54](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L54) +Defined in: [index.ts:55](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L55) A signal indicating whether the collection is currently loading @@ -97,7 +97,7 @@ A signal indicating whether the collection is currently loading isPersistedReady: Signal; ``` -Defined in: [index.ts:58](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L58) +Defined in: [index.ts:59](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L59) *** @@ -107,7 +107,7 @@ Defined in: [index.ts:58](https://github.com/TanStack/db/blob/main/packages/angu isReady: Signal; ``` -Defined in: [index.ts:56](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L56) +Defined in: [index.ts:57](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L57) A signal indicating whether the collection is ready @@ -119,7 +119,7 @@ A signal indicating whether the collection is ready persistedError: Signal; ``` -Defined in: [index.ts:59](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L59) +Defined in: [index.ts:60](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L60) *** @@ -129,7 +129,7 @@ Defined in: [index.ts:59](https://github.com/TanStack/db/blob/main/packages/angu persistedStatus: Signal; ``` -Defined in: [index.ts:57](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L57) +Defined in: [index.ts:58](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L58) *** @@ -139,7 +139,7 @@ Defined in: [index.ts:57](https://github.com/TanStack/db/blob/main/packages/angu state: Signal[K] }>>; ``` -Defined in: [index.ts:42](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L42) +Defined in: [index.ts:43](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L43) A signal containing the complete state map of results keyed by their ID @@ -151,6 +151,6 @@ A signal containing the complete state map of results keyed by their ID status: Signal; ``` -Defined in: [index.ts:52](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L52) +Defined in: [index.ts:53](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L53) A signal containing the current status of the collection diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md index 861eb59479..5892128e83 100644 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md +++ b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithCollection.md @@ -3,7 +3,7 @@ id: InjectLiveQueryResultWithCollection title: InjectLiveQueryResultWithCollection --- -Defined in: [index.ts:80](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L80) +Defined in: [index.ts:81](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L81) ## Type Parameters @@ -30,7 +30,7 @@ collection: Signal< | null>; ``` -Defined in: [index.ts:87](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L87) +Defined in: [index.ts:88](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L88) *** @@ -40,7 +40,7 @@ Defined in: [index.ts:87](https://github.com/TanStack/db/blob/main/packages/angu data: Signal; ``` -Defined in: [index.ts:86](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L86) +Defined in: [index.ts:87](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L87) *** @@ -50,7 +50,7 @@ Defined in: [index.ts:86](https://github.com/TanStack/db/blob/main/packages/angu isCleanedUp: Signal; ``` -Defined in: [index.ts:96](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L96) +Defined in: [index.ts:97](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L97) *** @@ -60,7 +60,7 @@ Defined in: [index.ts:96](https://github.com/TanStack/db/blob/main/packages/angu isError: Signal; ``` -Defined in: [index.ts:95](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L95) +Defined in: [index.ts:96](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L96) *** @@ -70,7 +70,7 @@ Defined in: [index.ts:95](https://github.com/TanStack/db/blob/main/packages/angu isIdle: Signal; ``` -Defined in: [index.ts:94](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L94) +Defined in: [index.ts:95](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L95) *** @@ -80,7 +80,7 @@ Defined in: [index.ts:94](https://github.com/TanStack/db/blob/main/packages/angu isLoading: Signal; ``` -Defined in: [index.ts:89](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L89) +Defined in: [index.ts:90](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L90) *** @@ -90,7 +90,7 @@ Defined in: [index.ts:89](https://github.com/TanStack/db/blob/main/packages/angu isPersistedReady: Signal; ``` -Defined in: [index.ts:92](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L92) +Defined in: [index.ts:93](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L93) *** @@ -100,7 +100,7 @@ Defined in: [index.ts:92](https://github.com/TanStack/db/blob/main/packages/angu isReady: Signal; ``` -Defined in: [index.ts:90](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L90) +Defined in: [index.ts:91](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L91) *** @@ -110,7 +110,7 @@ Defined in: [index.ts:90](https://github.com/TanStack/db/blob/main/packages/angu persistedError: Signal; ``` -Defined in: [index.ts:93](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L93) +Defined in: [index.ts:94](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L94) *** @@ -120,7 +120,7 @@ Defined in: [index.ts:93](https://github.com/TanStack/db/blob/main/packages/angu persistedStatus: Signal; ``` -Defined in: [index.ts:91](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L91) +Defined in: [index.ts:92](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L92) *** @@ -130,7 +130,7 @@ Defined in: [index.ts:91](https://github.com/TanStack/db/blob/main/packages/angu state: Signal>; ``` -Defined in: [index.ts:85](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L85) +Defined in: [index.ts:86](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L86) *** @@ -140,4 +140,4 @@ Defined in: [index.ts:85](https://github.com/TanStack/db/blob/main/packages/angu status: Signal; ``` -Defined in: [index.ts:88](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L88) +Defined in: [index.ts:89](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L89) diff --git a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md index 336834299a..e456bd589b 100644 --- a/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md +++ b/docs/framework/angular/reference/interfaces/InjectLiveQueryResultWithSingleResultCollection.md @@ -3,7 +3,7 @@ id: InjectLiveQueryResultWithSingleResultCollection title: InjectLiveQueryResultWithSingleResultCollection --- -Defined in: [index.ts:99](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L99) +Defined in: [index.ts:100](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L100) ## Type Parameters @@ -30,7 +30,7 @@ collection: Signal< | null>; ``` -Defined in: [index.ts:106](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L106) +Defined in: [index.ts:107](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L107) *** @@ -40,7 +40,7 @@ Defined in: [index.ts:106](https://github.com/TanStack/db/blob/main/packages/ang data: Signal; ``` -Defined in: [index.ts:105](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L105) +Defined in: [index.ts:106](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L106) *** @@ -50,7 +50,7 @@ Defined in: [index.ts:105](https://github.com/TanStack/db/blob/main/packages/ang isCleanedUp: Signal; ``` -Defined in: [index.ts:115](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L115) +Defined in: [index.ts:116](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L116) *** @@ -60,7 +60,7 @@ Defined in: [index.ts:115](https://github.com/TanStack/db/blob/main/packages/ang isError: Signal; ``` -Defined in: [index.ts:114](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L114) +Defined in: [index.ts:115](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L115) *** @@ -70,7 +70,7 @@ Defined in: [index.ts:114](https://github.com/TanStack/db/blob/main/packages/ang isIdle: Signal; ``` -Defined in: [index.ts:113](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L113) +Defined in: [index.ts:114](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L114) *** @@ -80,7 +80,7 @@ Defined in: [index.ts:113](https://github.com/TanStack/db/blob/main/packages/ang isLoading: Signal; ``` -Defined in: [index.ts:108](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L108) +Defined in: [index.ts:109](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L109) *** @@ -90,7 +90,7 @@ Defined in: [index.ts:108](https://github.com/TanStack/db/blob/main/packages/ang isPersistedReady: Signal; ``` -Defined in: [index.ts:111](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L111) +Defined in: [index.ts:112](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L112) *** @@ -100,7 +100,7 @@ Defined in: [index.ts:111](https://github.com/TanStack/db/blob/main/packages/ang isReady: Signal; ``` -Defined in: [index.ts:109](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L109) +Defined in: [index.ts:110](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L110) *** @@ -110,7 +110,7 @@ Defined in: [index.ts:109](https://github.com/TanStack/db/blob/main/packages/ang persistedError: Signal; ``` -Defined in: [index.ts:112](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L112) +Defined in: [index.ts:113](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L113) *** @@ -120,7 +120,7 @@ Defined in: [index.ts:112](https://github.com/TanStack/db/blob/main/packages/ang persistedStatus: Signal; ``` -Defined in: [index.ts:110](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L110) +Defined in: [index.ts:111](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L111) *** @@ -130,7 +130,7 @@ Defined in: [index.ts:110](https://github.com/TanStack/db/blob/main/packages/ang state: Signal>; ``` -Defined in: [index.ts:104](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L104) +Defined in: [index.ts:105](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L105) *** @@ -140,4 +140,4 @@ Defined in: [index.ts:104](https://github.com/TanStack/db/blob/main/packages/ang status: Signal; ``` -Defined in: [index.ts:107](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L107) +Defined in: [index.ts:108](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L108) diff --git a/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md b/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md index c8fa77ad70..9f231ce34a 100644 --- a/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md +++ b/docs/framework/angular/reference/type-aliases/InjectConditionalLiveQueryResult.md @@ -7,7 +7,7 @@ title: InjectConditionalLiveQueryResult type InjectConditionalLiveQueryResult = Omit, "data"> & object; ``` -Defined in: [index.ts:73](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L73) +Defined in: [index.ts:74](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L74) ## Type Declaration diff --git a/docs/framework/react/reference/functions/usePacedMutations.md b/docs/framework/react/reference/functions/usePacedMutations.md index 00affeb216..fc004e3549 100644 --- a/docs/framework/react/reference/functions/usePacedMutations.md +++ b/docs/framework/react/reference/functions/usePacedMutations.md @@ -7,13 +7,15 @@ title: usePacedMutations function usePacedMutations(config): (variables) => Transaction; ``` -Defined in: [usePacedMutations.ts:93](https://github.com/TanStack/db/blob/main/packages/react-db/src/usePacedMutations.ts#L93) +Defined in: [usePacedMutations.ts:95](https://github.com/TanStack/db/blob/main/packages/react-db/src/usePacedMutations.ts#L95) React hook for managing paced mutations with timing strategies. Provides optimistic mutations with pluggable strategies like debouncing, queuing, or throttling. The optimistic updates are applied immediately via `onMutate`, and the actual persistence is controlled by the strategy. +Callbacks follow the latest committed render, so a suspended render cannot +replace the callbacks used by active mutations. ## Type Parameters diff --git a/docs/framework/solid/reference/functions/useLiveQuery.md b/docs/framework/solid/reference/functions/useLiveQuery.md index 4f05f23ecc..065ee1bc2c 100644 --- a/docs/framework/solid/reference/functions/useLiveQuery.md +++ b/docs/framework/solid/reference/functions/useLiveQuery.md @@ -9,7 +9,7 @@ title: useLiveQuery function useLiveQuery(queryFn): Accessor> & object; ``` -Defined in: [useLiveQuery.ts:112](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L112) +Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L113) Create a live query using a query function @@ -109,7 +109,7 @@ return ( function useLiveQuery(queryFn): Accessor> & object; ``` -Defined in: [useLiveQuery.ts:134](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L134) +Defined in: [useLiveQuery.ts:135](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L135) Create a live query using a query function @@ -209,7 +209,7 @@ return ( function useLiveQuery(config): Accessor> & object; ``` -Defined in: [useLiveQuery.ts:198](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L198) +Defined in: [useLiveQuery.ts:199](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L199) Create a live query using configuration object @@ -278,7 +278,7 @@ return ( function useLiveQuery(liveQueryCollection): Accessor & object; ``` -Defined in: [useLiveQuery.ts:255](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L255) +Defined in: [useLiveQuery.ts:256](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L256) Subscribe to an existing live query collection @@ -350,7 +350,7 @@ return ( function useLiveQuery(liveQueryCollection): Accessor & object; ``` -Defined in: [useLiveQuery.ts:283](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L283) +Defined in: [useLiveQuery.ts:284](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L284) Create a live query using a query function diff --git a/docs/framework/svelte/reference/functions/useLiveQuery.md b/docs/framework/svelte/reference/functions/useLiveQuery.md index 740d740387..cd2ade1052 100644 --- a/docs/framework/svelte/reference/functions/useLiveQuery.md +++ b/docs/framework/svelte/reference/functions/useLiveQuery.md @@ -9,7 +9,7 @@ title: useLiveQuery function useLiveQuery(queryFn, deps?): UseLiveQueryReturn<{ [K in string | number | symbol]: ResultValue[K] }, InferResultType>; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:209](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L209) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:210](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L210) Create a live query using a query function @@ -135,7 +135,7 @@ const todosQuery = useLiveQuery((q) => function useLiveQuery(queryFn, deps?): ConditionalUseLiveQueryReturn<{ [K in string | number | symbol]: ResultValue[K] }, InferConditionalResultType>; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:215](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L215) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:216](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L216) Create a live query using a query function @@ -261,7 +261,7 @@ const todosQuery = useLiveQuery((q) => function useLiveQuery(config, deps?): UseLiveQueryReturn<{ [K in string | number | symbol]: ResultValue[K] }, InferResultType>; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:263](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L263) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:264](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L264) Create a live query using configuration object @@ -334,7 +334,7 @@ const itemsQuery = useLiveQuery({ function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithCollection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:312](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L312) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:313](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L313) Subscribe to an existing query collection (can be reactive) @@ -417,7 +417,7 @@ const queryResult = useLiveQuery(sharedQuery) function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithCollection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:323](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L323) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:324](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L324) Create a live query using a query function diff --git a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md index 1f4c184917..aedd412d40 100644 --- a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md +++ b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturn.md @@ -3,7 +3,7 @@ id: UseLiveQueryReturn title: UseLiveQueryReturn --- -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:57](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L57) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:58](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L58) Return type for useLiveQuery hook @@ -26,7 +26,7 @@ collection: Collection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:60](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L60) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:61](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L61) The underlying query collection instance @@ -38,7 +38,7 @@ The underlying query collection instance data: TData; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:59](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L59) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:60](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L60) Reactive array of query results in order, or single item when using findOne() @@ -50,7 +50,7 @@ Reactive array of query results in order, or single item when using findOne() isCleanedUp: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:69](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L69) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:70](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L70) True when query has been cleaned up @@ -62,7 +62,7 @@ True when query has been cleaned up isError: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:68](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L68) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:69](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L69) True when query encountered an error @@ -74,7 +74,7 @@ True when query encountered an error isIdle: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:67](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L67) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:68](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L68) True when query hasn't started yet @@ -86,7 +86,7 @@ True when query hasn't started yet isLoading: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:62](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L62) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:63](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L63) True while initial query data is loading @@ -98,7 +98,7 @@ True while initial query data is loading isPersistedReady: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:65](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L65) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:66](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L66) *** @@ -108,7 +108,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:65](https://github.co isReady: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:63](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L63) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:64](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L64) True when query has received first data and is ready @@ -120,7 +120,7 @@ True when query has received first data and is ready persistedError: unknown; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:66](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L66) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:67](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L67) *** @@ -130,7 +130,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:66](https://github.co persistedStatus: LiveQueryPersistedStatus; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:64](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L64) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:65](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L65) *** @@ -140,7 +140,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:64](https://github.co state: Map; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:58](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L58) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:59](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L59) Reactive Map of query results (key → item) @@ -152,6 +152,6 @@ Reactive Map of query results (key → item) status: CollectionStatus; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:61](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L61) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:62](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L62) Current query status diff --git a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md index 4ea9e7263f..a8cb0ff4e5 100644 --- a/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md +++ b/docs/framework/svelte/reference/interfaces/UseLiveQueryReturnWithCollection.md @@ -3,7 +3,7 @@ id: UseLiveQueryReturnWithCollection title: UseLiveQueryReturnWithCollection --- -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:85](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L85) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:86](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L86) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:85](https://github.co collection: Collection; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:93](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L93) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:94](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L94) *** @@ -41,7 +41,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:93](https://github.co data: TData; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:92](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L92) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:93](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L93) *** @@ -51,7 +51,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:92](https://github.co isCleanedUp: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:102](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L102) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:103](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L103) *** @@ -61,7 +61,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:102](https://github.c isError: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:101](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L101) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:102](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L102) *** @@ -71,7 +71,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:101](https://github.c isIdle: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:100](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L100) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:101](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L101) *** @@ -81,7 +81,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:100](https://github.c isLoading: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:95](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L95) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:96](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L96) *** @@ -91,7 +91,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:95](https://github.co isPersistedReady: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:98](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L98) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:99](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L99) *** @@ -101,7 +101,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:98](https://github.co isReady: boolean; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:96](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L96) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:97](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L97) *** @@ -111,7 +111,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:96](https://github.co persistedError: unknown; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:99](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L99) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:100](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L100) *** @@ -121,7 +121,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:99](https://github.co persistedStatus: LiveQueryPersistedStatus; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:97](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L97) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:98](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L98) *** @@ -131,7 +131,7 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:97](https://github.co state: Map; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:91](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L91) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:92](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L92) *** @@ -141,4 +141,4 @@ Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:91](https://github.co status: CollectionStatus; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:94](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L94) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:95](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L95) diff --git a/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md b/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md index a861fa2755..0d6fb132cc 100644 --- a/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md +++ b/docs/framework/svelte/reference/type-aliases/ConditionalUseLiveQueryReturn.md @@ -7,7 +7,7 @@ title: ConditionalUseLiveQueryReturn type ConditionalUseLiveQueryReturn = Omit, "collection" | "status"> & object; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:77](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L77) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:78](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L78) ## Type Declaration diff --git a/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md b/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md index f9b661bd7f..4c1468d9a8 100644 --- a/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md +++ b/docs/framework/svelte/reference/type-aliases/UseLiveQueryConfig.md @@ -7,7 +7,7 @@ title: UseLiveQueryConfig type UseLiveQueryConfig = LiveQueryCollectionConfig & object; ``` -Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:107](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L107) +Defined in: [packages/svelte-db/src/useLiveQuery.svelte.ts:108](https://github.com/TanStack/db/blob/main/packages/svelte-db/src/useLiveQuery.svelte.ts#L108) ## Type Declaration diff --git a/docs/framework/vue/reference/functions/useLiveQuery.md b/docs/framework/vue/reference/functions/useLiveQuery.md index a86b51cb02..86d6402dac 100644 --- a/docs/framework/vue/reference/functions/useLiveQuery.md +++ b/docs/framework/vue/reference/functions/useLiveQuery.md @@ -9,7 +9,7 @@ title: useLiveQuery function useLiveQuery(queryFn, deps?): UseLiveQueryReturn; ``` -Defined in: [useLiveQuery.ts:176](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L176) +Defined in: [useLiveQuery.ts:177](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L177) Create a live query using a query function @@ -95,7 +95,7 @@ const { data, isLoading, isError, status } = useLiveQuery((q) => function useLiveQuery(queryFn, deps?): ConditionalUseLiveQueryReturn; ``` -Defined in: [useLiveQuery.ts:182](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L182) +Defined in: [useLiveQuery.ts:183](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L183) Create a live query using a query function @@ -181,7 +181,7 @@ const { data, isLoading, isError, status } = useLiveQuery((q) => function useLiveQuery(config, deps?): UseLiveQueryReturn; ``` -Defined in: [useLiveQuery.ts:222](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L222) +Defined in: [useLiveQuery.ts:223](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L223) Create a live query using configuration object @@ -249,7 +249,7 @@ const { data, isLoading, isReady, isError } = useLiveQuery({ function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithCollection; ``` -Defined in: [useLiveQuery.ts:267](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L267) +Defined in: [useLiveQuery.ts:268](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L268) Subscribe to an existing query collection (can be reactive) @@ -328,7 +328,7 @@ const { data, isLoading, isError } = useLiveQuery(sharedQuery) function useLiveQuery(liveQueryCollection): UseLiveQueryReturnWithSingleResultCollection; ``` -Defined in: [useLiveQuery.ts:278](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L278) +Defined in: [useLiveQuery.ts:279](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L279) Create a live query using a query function diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md b/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md index 08a652a458..51a23beac0 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md +++ b/docs/framework/vue/reference/interfaces/UseLiveQueryReturn.md @@ -3,7 +3,7 @@ id: UseLiveQueryReturn title: UseLiveQueryReturn --- -Defined in: [useLiveQuery.ts:55](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L55) +Defined in: [useLiveQuery.ts:56](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L56) Return type for useLiveQuery hook @@ -22,7 +22,7 @@ collection: ComputedRef, { [K in string | number | symbol]: ResultValue[K] }>>; ``` -Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L58) +Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) The underlying query collection instance @@ -34,7 +34,7 @@ The underlying query collection instance data: ComputedRef>; ``` -Defined in: [useLiveQuery.ts:57](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L57) +Defined in: [useLiveQuery.ts:58](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L58) Reactive array of query results in order, or single result for findOne queries @@ -46,7 +46,7 @@ Reactive array of query results in order, or single result for findOne queries isCleanedUp: ComputedRef; ``` -Defined in: [useLiveQuery.ts:67](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L67) +Defined in: [useLiveQuery.ts:68](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L68) True when query has been cleaned up @@ -58,7 +58,7 @@ True when query has been cleaned up isError: ComputedRef; ``` -Defined in: [useLiveQuery.ts:66](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L66) +Defined in: [useLiveQuery.ts:67](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L67) True when query encountered an error @@ -70,7 +70,7 @@ True when query encountered an error isIdle: ComputedRef; ``` -Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) +Defined in: [useLiveQuery.ts:66](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L66) True when query hasn't started yet @@ -82,7 +82,7 @@ True when query hasn't started yet isLoading: ComputedRef; ``` -Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) +Defined in: [useLiveQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L61) True while initial query data is loading @@ -94,7 +94,7 @@ True while initial query data is loading isPersistedReady: ComputedRef; ``` -Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L63) +Defined in: [useLiveQuery.ts:64](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L64) *** @@ -104,7 +104,7 @@ Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packag isReady: ComputedRef; ``` -Defined in: [useLiveQuery.ts:61](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L61) +Defined in: [useLiveQuery.ts:62](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L62) True when query has received first data and is ready @@ -116,7 +116,7 @@ True when query has received first data and is ready persistedError: ComputedRef; ``` -Defined in: [useLiveQuery.ts:64](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L64) +Defined in: [useLiveQuery.ts:65](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L65) *** @@ -126,7 +126,7 @@ Defined in: [useLiveQuery.ts:64](https://github.com/TanStack/db/blob/main/packag persistedStatus: ComputedRef; ``` -Defined in: [useLiveQuery.ts:62](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L62) +Defined in: [useLiveQuery.ts:63](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L63) *** @@ -136,7 +136,7 @@ Defined in: [useLiveQuery.ts:62](https://github.com/TanStack/db/blob/main/packag state: ComputedRef[K] }>>; ``` -Defined in: [useLiveQuery.ts:56](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L56) +Defined in: [useLiveQuery.ts:57](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L57) Reactive Map of query results (key → item) @@ -148,6 +148,6 @@ Reactive Map of query results (key → item) status: ComputedRef; ``` -Defined in: [useLiveQuery.ts:59](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L59) +Defined in: [useLiveQuery.ts:60](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L60) Current query status diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md index c3f85ae149..ff6f9a6cb0 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md +++ b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithCollection.md @@ -3,7 +3,7 @@ id: UseLiveQueryReturnWithCollection title: UseLiveQueryReturnWithCollection --- -Defined in: [useLiveQuery.ts:88](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L88) +Defined in: [useLiveQuery.ts:89](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L89) ## Type Parameters @@ -27,7 +27,7 @@ Defined in: [useLiveQuery.ts:88](https://github.com/TanStack/db/blob/main/packag collection: ComputedRef, T>>; ``` -Defined in: [useLiveQuery.ts:95](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L95) +Defined in: [useLiveQuery.ts:96](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L96) *** @@ -37,7 +37,7 @@ Defined in: [useLiveQuery.ts:95](https://github.com/TanStack/db/blob/main/packag data: ComputedRef; ``` -Defined in: [useLiveQuery.ts:94](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L94) +Defined in: [useLiveQuery.ts:95](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L95) *** @@ -47,7 +47,7 @@ Defined in: [useLiveQuery.ts:94](https://github.com/TanStack/db/blob/main/packag isCleanedUp: ComputedRef; ``` -Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L104) +Defined in: [useLiveQuery.ts:105](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L105) *** @@ -57,7 +57,7 @@ Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packa isError: ComputedRef; ``` -Defined in: [useLiveQuery.ts:103](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L103) +Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L104) *** @@ -67,7 +67,7 @@ Defined in: [useLiveQuery.ts:103](https://github.com/TanStack/db/blob/main/packa isIdle: ComputedRef; ``` -Defined in: [useLiveQuery.ts:102](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L102) +Defined in: [useLiveQuery.ts:103](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L103) *** @@ -77,7 +77,7 @@ Defined in: [useLiveQuery.ts:102](https://github.com/TanStack/db/blob/main/packa isLoading: ComputedRef; ``` -Defined in: [useLiveQuery.ts:97](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L97) +Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L98) *** @@ -87,7 +87,7 @@ Defined in: [useLiveQuery.ts:97](https://github.com/TanStack/db/blob/main/packag isPersistedReady: ComputedRef; ``` -Defined in: [useLiveQuery.ts:100](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L100) +Defined in: [useLiveQuery.ts:101](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L101) *** @@ -97,7 +97,7 @@ Defined in: [useLiveQuery.ts:100](https://github.com/TanStack/db/blob/main/packa isReady: ComputedRef; ``` -Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L98) +Defined in: [useLiveQuery.ts:99](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L99) *** @@ -107,7 +107,7 @@ Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packag persistedError: ComputedRef; ``` -Defined in: [useLiveQuery.ts:101](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L101) +Defined in: [useLiveQuery.ts:102](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L102) *** @@ -117,7 +117,7 @@ Defined in: [useLiveQuery.ts:101](https://github.com/TanStack/db/blob/main/packa persistedStatus: ComputedRef; ``` -Defined in: [useLiveQuery.ts:99](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L99) +Defined in: [useLiveQuery.ts:100](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L100) *** @@ -127,7 +127,7 @@ Defined in: [useLiveQuery.ts:99](https://github.com/TanStack/db/blob/main/packag state: ComputedRef>; ``` -Defined in: [useLiveQuery.ts:93](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L93) +Defined in: [useLiveQuery.ts:94](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L94) *** @@ -137,4 +137,4 @@ Defined in: [useLiveQuery.ts:93](https://github.com/TanStack/db/blob/main/packag status: ComputedRef; ``` -Defined in: [useLiveQuery.ts:96](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L96) +Defined in: [useLiveQuery.ts:97](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L97) diff --git a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md index 776816b5f3..56eab708f4 100644 --- a/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md +++ b/docs/framework/vue/reference/interfaces/UseLiveQueryReturnWithSingleResultCollection.md @@ -3,7 +3,7 @@ id: UseLiveQueryReturnWithSingleResultCollection title: UseLiveQueryReturnWithSingleResultCollection --- -Defined in: [useLiveQuery.ts:107](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L107) +Defined in: [useLiveQuery.ts:108](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L108) ## Type Parameters @@ -27,7 +27,7 @@ Defined in: [useLiveQuery.ts:107](https://github.com/TanStack/db/blob/main/packa collection: ComputedRef, T> & SingleResult>; ``` -Defined in: [useLiveQuery.ts:114](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L114) +Defined in: [useLiveQuery.ts:115](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L115) *** @@ -37,7 +37,7 @@ Defined in: [useLiveQuery.ts:114](https://github.com/TanStack/db/blob/main/packa data: ComputedRef; ``` -Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L113) +Defined in: [useLiveQuery.ts:114](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L114) *** @@ -47,7 +47,7 @@ Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packa isCleanedUp: ComputedRef; ``` -Defined in: [useLiveQuery.ts:123](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L123) +Defined in: [useLiveQuery.ts:124](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L124) *** @@ -57,7 +57,7 @@ Defined in: [useLiveQuery.ts:123](https://github.com/TanStack/db/blob/main/packa isError: ComputedRef; ``` -Defined in: [useLiveQuery.ts:122](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L122) +Defined in: [useLiveQuery.ts:123](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L123) *** @@ -67,7 +67,7 @@ Defined in: [useLiveQuery.ts:122](https://github.com/TanStack/db/blob/main/packa isIdle: ComputedRef; ``` -Defined in: [useLiveQuery.ts:121](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L121) +Defined in: [useLiveQuery.ts:122](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L122) *** @@ -77,7 +77,7 @@ Defined in: [useLiveQuery.ts:121](https://github.com/TanStack/db/blob/main/packa isLoading: ComputedRef; ``` -Defined in: [useLiveQuery.ts:116](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L116) +Defined in: [useLiveQuery.ts:117](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L117) *** @@ -87,7 +87,7 @@ Defined in: [useLiveQuery.ts:116](https://github.com/TanStack/db/blob/main/packa isPersistedReady: ComputedRef; ``` -Defined in: [useLiveQuery.ts:119](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L119) +Defined in: [useLiveQuery.ts:120](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L120) *** @@ -97,7 +97,7 @@ Defined in: [useLiveQuery.ts:119](https://github.com/TanStack/db/blob/main/packa isReady: ComputedRef; ``` -Defined in: [useLiveQuery.ts:117](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L117) +Defined in: [useLiveQuery.ts:118](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L118) *** @@ -107,7 +107,7 @@ Defined in: [useLiveQuery.ts:117](https://github.com/TanStack/db/blob/main/packa persistedError: ComputedRef; ``` -Defined in: [useLiveQuery.ts:120](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L120) +Defined in: [useLiveQuery.ts:121](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L121) *** @@ -117,7 +117,7 @@ Defined in: [useLiveQuery.ts:120](https://github.com/TanStack/db/blob/main/packa persistedStatus: ComputedRef; ``` -Defined in: [useLiveQuery.ts:118](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L118) +Defined in: [useLiveQuery.ts:119](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L119) *** @@ -127,7 +127,7 @@ Defined in: [useLiveQuery.ts:118](https://github.com/TanStack/db/blob/main/packa state: ComputedRef>; ``` -Defined in: [useLiveQuery.ts:112](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L112) +Defined in: [useLiveQuery.ts:113](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L113) *** @@ -137,4 +137,4 @@ Defined in: [useLiveQuery.ts:112](https://github.com/TanStack/db/blob/main/packa status: ComputedRef; ``` -Defined in: [useLiveQuery.ts:115](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L115) +Defined in: [useLiveQuery.ts:116](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L116) diff --git a/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md b/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md index 472b2d710a..7438e96eb3 100644 --- a/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md +++ b/docs/framework/vue/reference/type-aliases/ConditionalUseLiveQueryReturn.md @@ -7,7 +7,7 @@ title: ConditionalUseLiveQueryReturn type ConditionalUseLiveQueryReturn = Omit, "data" | "collection" | "status"> & object; ``` -Defined in: [useLiveQuery.ts:75](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L75) +Defined in: [useLiveQuery.ts:76](https://github.com/TanStack/db/blob/main/packages/vue-db/src/useLiveQuery.ts#L76) ## Type Declaration diff --git a/docs/reference/classes/CollectionImpl.md b/docs/reference/classes/CollectionImpl.md index 46e7436f5e..0203f77893 100644 --- a/docs/reference/classes/CollectionImpl.md +++ b/docs/reference/classes/CollectionImpl.md @@ -203,7 +203,7 @@ Do not mutate the backing map or its rows: that bypasses publication. get compareOptions(): StringCollationConfig; ``` -Defined in: [packages/db/src/collection/index.ts:913](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L913) +Defined in: [packages/db/src/collection/index.ts:918](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L918) ##### Returns @@ -219,7 +219,7 @@ Defined in: [packages/db/src/collection/index.ts:913](https://github.com/TanStac get indexes(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L898) +Defined in: [packages/db/src/collection/index.ts:903](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L903) Get resolved indexes for query optimization @@ -257,7 +257,7 @@ true if the collection has pending load more operations, false otherwise get size(): number; ``` -Defined in: [packages/db/src/collection/index.ts:763](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L763) +Defined in: [packages/db/src/collection/index.ts:768](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L768) Get the current size of the collection (cached) @@ -275,7 +275,7 @@ Get the current size of the collection (cached) get state(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:1090](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1090) +Defined in: [packages/db/src/collection/index.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1095) Gets the current state of the collection as a Map @@ -348,7 +348,7 @@ query that has no subscriber or preload of its own does not count. get toArray(): WithVirtualProps[]; ``` -Defined in: [packages/db/src/collection/index.ts:1114](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1114) +Defined in: [packages/db/src/collection/index.ts:1119](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1119) Gets the current state of the collection as an Array @@ -392,6 +392,22 @@ Defined in: [packages/db/src/collection/index.ts:665](https://github.com/TanStac *** +### \_hasHeldSyncTransaction() + +```ts +_hasHeldSyncTransaction(): boolean; +``` + +Defined in: [packages/db/src/collection/index.ts:761](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L761) + +Whether an accepted sync transaction is not yet visible. + +#### Returns + +`boolean` + +*** + ### \_hasHydratedKey() ```ts @@ -656,7 +672,7 @@ Applied metadata keys without a source row. iterator: IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:801](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L801) +Defined in: [packages/db/src/collection/index.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L806) Get all entries (virtual derived state) @@ -672,7 +688,7 @@ Get all entries (virtual derived state) cleanup(): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1281](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1281) +Defined in: [packages/db/src/collection/index.ts:1286](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1286) Clean up the collection by stopping sync and clearing data This can be called manually or automatically by garbage collection @@ -693,7 +709,7 @@ final cleaned-up state. createIndex(indexCallback, config): BaseIndex; ``` -Defined in: [packages/db/src/collection/index.ts:867](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L867) +Defined in: [packages/db/src/collection/index.ts:872](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L872) Creates an index on a collection for faster queries. Indexes significantly improve query performance by allowing constant time lookups @@ -749,7 +765,7 @@ currentStateAsChanges(options): | ChangeMessage, TKey>[]; ``` -Defined in: [packages/db/src/collection/index.ts:1147](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1147) +Defined in: [packages/db/src/collection/index.ts:1152](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1152) Returns the current state of the collection as an array of changes @@ -793,7 +809,7 @@ const activeChanges = collection.currentStateAsChanges({ delete(keys, config?): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1067](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1067) +Defined in: [packages/db/src/collection/index.ts:1072](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1072) Deletes one or more items from the collection @@ -856,7 +872,7 @@ try { entries(): IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:789](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L789) +Defined in: [packages/db/src/collection/index.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L794) Get all entries (virtual derived state) @@ -872,7 +888,7 @@ Get all entries (virtual derived state) forEach(callbackfn): void; ``` -Defined in: [packages/db/src/collection/index.ts:810](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L810) +Defined in: [packages/db/src/collection/index.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L815) Execute a callback for each entry in the collection @@ -919,7 +935,7 @@ Get the current value for a key (virtual derived state) getIndexMetadata(): CollectionIndexMetadata[]; ``` -Defined in: [packages/db/src/collection/index.ts:891](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L891) +Defined in: [packages/db/src/collection/index.ts:896](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L896) Returns a snapshot of current index metadata sorted by indexId. Persistence wrappers can use this to bootstrap index state if indexes were @@ -937,7 +953,7 @@ created before event listeners were attached. getKeyFromItem(item): TKey; ``` -Defined in: [packages/db/src/collection/index.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L841) +Defined in: [packages/db/src/collection/index.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L846) #### Parameters @@ -981,7 +997,7 @@ insert(data, config?): | Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:954](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L954) +Defined in: [packages/db/src/collection/index.ts:959](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L959) Inserts one or more items into the collection @@ -1082,7 +1098,7 @@ if (collection.isReady()) { keys(): IterableIterator; ``` -Defined in: [packages/db/src/collection/index.ts:770](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L770) +Defined in: [packages/db/src/collection/index.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L775) Get all keys (virtual derived state) @@ -1098,7 +1114,7 @@ Get all keys (virtual derived state) map(callbackfn): U[]; ``` -Defined in: [packages/db/src/collection/index.ts:826](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L826) +Defined in: [packages/db/src/collection/index.ts:831](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L831) Create a new array with the results of calling a function for each entry in the collection @@ -1126,7 +1142,7 @@ Create a new array with the results of calling a function for each entry in the off(event, callback): void; ``` -Defined in: [packages/db/src/collection/index.ts:1256](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1256) +Defined in: [packages/db/src/collection/index.ts:1261](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1261) Unsubscribe from a collection event @@ -1144,6 +1160,7 @@ Unsubscribe from a collection event \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` @@ -1169,7 +1186,7 @@ Unsubscribe from a collection event on(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1236](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1236) +Defined in: [packages/db/src/collection/index.ts:1241](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1241) Subscribe to a collection event @@ -1187,6 +1204,7 @@ Subscribe to a collection event \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` @@ -1218,7 +1236,7 @@ Subscribe to a collection event once(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1246](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1246) +Defined in: [packages/db/src/collection/index.ts:1251](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1251) Subscribe to a collection event once @@ -1236,6 +1254,7 @@ Subscribe to a collection event once \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` @@ -1329,7 +1348,7 @@ Multiple concurrent calls will share the same promise removeIndex(indexOrId): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L882) +Defined in: [packages/db/src/collection/index.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L887) Removes an index created with createIndex. Returns true when an index existed and was removed. @@ -1374,7 +1393,7 @@ Throws during active cleanup; restart after cleanup completes instead. stateWhenReady(): Promise>>; ``` -Defined in: [packages/db/src/collection/index.ts:1105](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1105) +Defined in: [packages/db/src/collection/index.ts:1110](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1110) Gets the current state of the collection as a Map once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1396,7 +1415,7 @@ Promise that resolves to a Map containing all items in the collection subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1199](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1199) +Defined in: [packages/db/src/collection/index.ts:1204](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1204) Subscribe to changes in the collection Changes to the same key retain their causal order within a callback. @@ -1471,7 +1490,7 @@ const subscription = collection.subscribeChanges((changes) => { subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1207](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1207) +Defined in: [packages/db/src/collection/index.ts:1212](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1212) Subscribe to changes in the collection Changes to the same key retain their causal order within a callback. @@ -1548,7 +1567,7 @@ const subscription = collection.subscribeChanges((changes) => { toArrayWhenReady(): Promise[]>; ``` -Defined in: [packages/db/src/collection/index.ts:1125](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1125) +Defined in: [packages/db/src/collection/index.ts:1130](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1130) Gets the current state of the collection as an Array once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1570,7 +1589,7 @@ Promise that resolves to an Array containing all items in the collection update(key, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:999](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L999) +Defined in: [packages/db/src/collection/index.ts:1004](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1004) Updates one or more items in the collection using a callback function @@ -1641,7 +1660,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1005](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1005) +Defined in: [packages/db/src/collection/index.ts:1010](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1010) Updates one or more items in the collection using a callback function @@ -1715,7 +1734,7 @@ try { update(id, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1012](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1012) +Defined in: [packages/db/src/collection/index.ts:1017](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1017) Updates one or more items in the collection using a callback function @@ -1786,7 +1805,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1018](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1018) +Defined in: [packages/db/src/collection/index.ts:1023](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1023) Updates one or more items in the collection using a callback function @@ -1863,7 +1882,7 @@ validateData( key?): TOutput; ``` -Defined in: [packages/db/src/collection/index.ts:905](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L905) +Defined in: [packages/db/src/collection/index.ts:910](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L910) Validates the data against the schema @@ -1893,7 +1912,7 @@ Validates the data against the schema values(): IterableIterator>; ``` -Defined in: [packages/db/src/collection/index.ts:777](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L777) +Defined in: [packages/db/src/collection/index.ts:782](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L782) Get all values (virtual derived state) @@ -1909,7 +1928,7 @@ Get all values (virtual derived state) waitFor(event, timeout?): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1266](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1266) +Defined in: [packages/db/src/collection/index.ts:1271](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1271) Wait for a collection event @@ -1927,6 +1946,7 @@ Wait for a collection event \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` diff --git a/docs/reference/classes/DatabaseRequiredError.md b/docs/reference/classes/DatabaseRequiredError.md index 784aa0400b..9450494b85 100644 --- a/docs/reference/classes/DatabaseRequiredError.md +++ b/docs/reference/classes/DatabaseRequiredError.md @@ -3,7 +3,7 @@ id: DatabaseRequiredError title: DatabaseRequiredError --- -Defined in: [packages/db/src/indexed-db.ts:33](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L33) +Defined in: [packages/db/src/indexed-db.ts:37](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L37) ## Extends @@ -17,7 +17,7 @@ Defined in: [packages/db/src/indexed-db.ts:33](https://github.com/TanStack/db/bl new DatabaseRequiredError(): DatabaseRequiredError; ``` -Defined in: [packages/db/src/indexed-db.ts:34](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L34) +Defined in: [packages/db/src/indexed-db.ts:38](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L38) #### Returns diff --git a/docs/reference/classes/GetKeyRequiredError.md b/docs/reference/classes/GetKeyRequiredError.md index 70bece1052..cecece9bc5 100644 --- a/docs/reference/classes/GetKeyRequiredError.md +++ b/docs/reference/classes/GetKeyRequiredError.md @@ -3,7 +3,7 @@ id: GetKeyRequiredError title: GetKeyRequiredError --- -Defined in: [packages/db/src/indexed-db.ts:83](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L83) +Defined in: [packages/db/src/indexed-db.ts:87](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L87) Thrown when the getKey function is missing @@ -19,7 +19,7 @@ Thrown when the getKey function is missing new GetKeyRequiredError(): GetKeyRequiredError; ``` -Defined in: [packages/db/src/indexed-db.ts:84](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L84) +Defined in: [packages/db/src/indexed-db.ts:88](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L88) #### Returns diff --git a/docs/reference/classes/NameRequiredError.md b/docs/reference/classes/NameRequiredError.md index 273ed7a503..c417781498 100644 --- a/docs/reference/classes/NameRequiredError.md +++ b/docs/reference/classes/NameRequiredError.md @@ -3,7 +3,7 @@ id: NameRequiredError title: NameRequiredError --- -Defined in: [packages/db/src/indexed-db.ts:68](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L68) +Defined in: [packages/db/src/indexed-db.ts:72](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L72) Thrown when the name (object store) configuration is missing @@ -19,7 +19,7 @@ Thrown when the name (object store) configuration is missing new NameRequiredError(): NameRequiredError; ``` -Defined in: [packages/db/src/indexed-db.ts:69](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L69) +Defined in: [packages/db/src/indexed-db.ts:73](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L73) #### Returns diff --git a/docs/reference/classes/ObjectStoreNotFoundError.md b/docs/reference/classes/ObjectStoreNotFoundError.md index da68bf2281..80ad19460e 100644 --- a/docs/reference/classes/ObjectStoreNotFoundError.md +++ b/docs/reference/classes/ObjectStoreNotFoundError.md @@ -3,7 +3,7 @@ id: ObjectStoreNotFoundError title: ObjectStoreNotFoundError --- -Defined in: [packages/db/src/indexed-db.ts:48](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L48) +Defined in: [packages/db/src/indexed-db.ts:52](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L52) Thrown when the specified object store doesn't exist in the database @@ -22,7 +22,7 @@ new ObjectStoreNotFoundError( availableStores): ObjectStoreNotFoundError; ``` -Defined in: [packages/db/src/indexed-db.ts:49](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L49) +Defined in: [packages/db/src/indexed-db.ts:53](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L53) #### Parameters diff --git a/docs/reference/functions/createIndexedDB.md b/docs/reference/functions/createIndexedDB.md index e7a8c23b5d..44f240a943 100644 --- a/docs/reference/functions/createIndexedDB.md +++ b/docs/reference/functions/createIndexedDB.md @@ -7,7 +7,7 @@ title: createIndexedDB function createIndexedDB(options): Promise; ``` -Defined in: [packages/db/src/indexed-db.ts:290](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L290) +Defined in: [packages/db/src/indexed-db.ts:294](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L294) Creates or opens an IndexedDB database with the specified stores. Call this once at app startup, then pass the instance to collections. diff --git a/docs/reference/functions/findIndexForField.md b/docs/reference/functions/findIndexForField.md index fb291390b8..51168e5ca2 100644 --- a/docs/reference/functions/findIndexForField.md +++ b/docs/reference/functions/findIndexForField.md @@ -7,12 +7,13 @@ title: findIndexForField function findIndexForField( collection, fieldPath, - compareOptions?): IndexReader | undefined; + compareOptions?, + canUse?): IndexReader | undefined; ``` -Defined in: [packages/db/src/utils/index-optimization.ts:45](https://github.com/TanStack/db/blob/main/packages/db/src/utils/index-optimization.ts#L45) +Defined in: [packages/db/src/utils/index-optimization.ts:59](https://github.com/TanStack/db/blob/main/packages/db/src/utils/index-optimization.ts#L59) -Finds an index that matches a given field path +Finds the first usable index matching a field path and comparison options. ## Type Parameters @@ -34,6 +35,10 @@ Finds an index that matches a given field path `CompareOptions` +### canUse? + +(`index`) => `boolean` + ## Returns [`IndexReader`](../type-aliases/IndexReader.md)\<`TKey`\> \| `undefined` diff --git a/docs/reference/functions/indexedDBCollectionOptions.md b/docs/reference/functions/indexedDBCollectionOptions.md index 41aaed5732..d05f7c8f99 100644 --- a/docs/reference/functions/indexedDBCollectionOptions.md +++ b/docs/reference/functions/indexedDBCollectionOptions.md @@ -9,7 +9,7 @@ title: indexedDBCollectionOptions function indexedDBCollectionOptions(config): CollectionConfig, TKey, T, IndexedDBCollectionUtils, InferSchemaInput>> & object; ``` -Defined in: [packages/db/src/indexed-db.ts:422](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L422) +Defined in: [packages/db/src/indexed-db.ts:438](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L438) Creates IndexedDB collection options for use with a standard Collection. This provides persistent local storage with cross-tab synchronization. @@ -76,7 +76,7 @@ const todosCollection = createCollection( function indexedDBCollectionOptions(config): CollectionConfig> & object; ``` -Defined in: [packages/db/src/indexed-db.ts:440](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L440) +Defined in: [packages/db/src/indexed-db.ts:456](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L456) Creates IndexedDB collection options for use with a standard Collection. This provides persistent local storage with cross-tab synchronization. diff --git a/docs/reference/functions/localStorageCollectionOptions.md b/docs/reference/functions/localStorageCollectionOptions.md index 3f504804bf..2f9d1a67cd 100644 --- a/docs/reference/functions/localStorageCollectionOptions.md +++ b/docs/reference/functions/localStorageCollectionOptions.md @@ -9,7 +9,7 @@ title: localStorageCollectionOptions function localStorageCollectionOptions(config): CollectionConfig, TKey, T, LocalStorageCollectionUtils> & object; ``` -Defined in: [packages/db/src/local-storage.ts:386](https://github.com/TanStack/db/blob/main/packages/db/src/local-storage.ts#L386) +Defined in: [packages/db/src/local-storage.ts:496](https://github.com/TanStack/db/blob/main/packages/db/src/local-storage.ts#L496) Creates localStorage collection options for use with a standard Collection @@ -128,7 +128,7 @@ await tx.commit() function localStorageCollectionOptions(config): CollectionConfig & object; ``` -Defined in: [packages/db/src/local-storage.ts:406](https://github.com/TanStack/db/blob/main/packages/db/src/local-storage.ts#L406) +Defined in: [packages/db/src/local-storage.ts:516](https://github.com/TanStack/db/blob/main/packages/db/src/local-storage.ts#L516) Creates localStorage collection options for use with a standard Collection diff --git a/docs/reference/functions/makeComparator.md b/docs/reference/functions/makeComparator.md new file mode 100644 index 0000000000..3bfa4ae445 --- /dev/null +++ b/docs/reference/functions/makeComparator.md @@ -0,0 +1,44 @@ +--- +id: makeComparator +title: makeComparator +--- + +```ts +function makeComparator(opts, scope): (a, b) => number; +``` + +Defined in: [packages/db/src/utils/comparison.ts:141](https://github.com/TanStack/db/blob/main/packages/db/src/utils/comparison.ts#L141) + +**`Internal`** + +Used by first-party collection adapters. + +## Parameters + +### opts + +`CompareOptions` + +### scope + +`"values"` | `"index"` + +## Returns + +```ts +(a, b): number; +``` + +### Parameters + +#### a + +`any` + +#### b + +`any` + +### Returns + +`number` diff --git a/docs/reference/functions/optimizeExpressionWithIndexes.md b/docs/reference/functions/optimizeExpressionWithIndexes.md index 9a1a25da0e..2903e8e6de 100644 --- a/docs/reference/functions/optimizeExpressionWithIndexes.md +++ b/docs/reference/functions/optimizeExpressionWithIndexes.md @@ -7,7 +7,7 @@ title: optimizeExpressionWithIndexes function optimizeExpressionWithIndexes(expression, collection): OptimizationResult; ``` -Defined in: [packages/db/src/utils/index-optimization.ts:200](https://github.com/TanStack/db/blob/main/packages/db/src/utils/index-optimization.ts#L200) +Defined in: [packages/db/src/utils/index-optimization.ts:215](https://github.com/TanStack/db/blob/main/packages/db/src/utils/index-optimization.ts#L215) Optimizes a query expression using available indexes to find matching keys diff --git a/docs/reference/index.md b/docs/reference/index.md index 7d43a88931..486890d811 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -419,6 +419,7 @@ title: "@tanstack/db" - [lower](functions/lower.md) - [lt](functions/lt.md) - [lte](functions/lte.md) +- [makeComparator](functions/makeComparator.md) - [materialize](functions/materialize.md) - [max](functions/max.md) - [min](functions/min.md) diff --git a/docs/reference/interfaces/BaseCollectionConfig.md b/docs/reference/interfaces/BaseCollectionConfig.md index e6992c10a4..f3ba797f22 100644 --- a/docs/reference/interfaces/BaseCollectionConfig.md +++ b/docs/reference/interfaces/BaseCollectionConfig.md @@ -3,7 +3,7 @@ id: BaseCollectionConfig title: BaseCollectionConfig --- -Defined in: [packages/db/src/types.ts:740](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L740) +Defined in: [packages/db/src/types.ts:762](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L762) ## Extended by @@ -41,7 +41,7 @@ Defined in: [packages/db/src/types.ts:740](https://github.com/TanStack/db/blob/m optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L794) +Defined in: [packages/db/src/types.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L816) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -66,7 +66,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:819](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L819) +Defined in: [packages/db/src/types.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L841) Optional function to compare two items. This is used to order the items in the collection. @@ -106,7 +106,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:808](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L808) +Defined in: [packages/db/src/types.ts:830](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L830) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -130,7 +130,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1014) +Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -145,7 +145,7 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L773) +Defined in: [packages/db/src/types.ts:795](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L795) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). @@ -162,7 +162,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:764](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L764) +Defined in: [packages/db/src/types.ts:786](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L786) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -196,7 +196,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L753) +Defined in: [packages/db/src/types.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L775) *** @@ -208,7 +208,7 @@ optional onDelete: | DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1003](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1003) +Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1025) Optional asynchronous handler function called before a delete operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -281,7 +281,7 @@ optional onInsert: | InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L882) +Defined in: [packages/db/src/types.ts:904](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L904) Optional asynchronous handler function called before an insert operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -352,7 +352,7 @@ optional onUpdate: | UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:944](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L944) +Defined in: [packages/db/src/types.ts:966](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L966) Optional asynchronous handler function called before an update operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -425,7 +425,7 @@ onUpdate: async ({ transaction, collection }) => { optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L754) +Defined in: [packages/db/src/types.ts:776](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L776) *** @@ -435,7 +435,7 @@ Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:784](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L784) +Defined in: [packages/db/src/types.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L806) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -458,7 +458,7 @@ false optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) +Defined in: [packages/db/src/types.ts:850](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L850) The mode of sync to use for the collection. @@ -480,4 +480,4 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: TUtils; ``` -Defined in: [packages/db/src/types.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1016) +Defined in: [packages/db/src/types.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1038) diff --git a/docs/reference/interfaces/ChangeMessage.md b/docs/reference/interfaces/ChangeMessage.md index 369e4bed3f..01b597701c 100644 --- a/docs/reference/interfaces/ChangeMessage.md +++ b/docs/reference/interfaces/ChangeMessage.md @@ -3,7 +3,7 @@ id: ChangeMessage title: ChangeMessage --- -Defined in: [packages/db/src/types.ts:578](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L578) +Defined in: [packages/db/src/types.ts:600](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L600) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/types.ts:578](https://github.com/TanStack/db/blob/m key: TKey; ``` -Defined in: [packages/db/src/types.ts:582](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L582) +Defined in: [packages/db/src/types.ts:604](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L604) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/types.ts:582](https://github.com/TanStack/db/blob/m optional metadata: Record; ``` -Defined in: [packages/db/src/types.ts:586](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L586) +Defined in: [packages/db/src/types.ts:608](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L608) *** @@ -43,7 +43,7 @@ Defined in: [packages/db/src/types.ts:586](https://github.com/TanStack/db/blob/m optional previousValue: T; ``` -Defined in: [packages/db/src/types.ts:584](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L584) +Defined in: [packages/db/src/types.ts:606](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L606) *** @@ -53,7 +53,7 @@ Defined in: [packages/db/src/types.ts:584](https://github.com/TanStack/db/blob/m type: OperationType; ``` -Defined in: [packages/db/src/types.ts:585](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L585) +Defined in: [packages/db/src/types.ts:607](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L607) *** @@ -63,4 +63,4 @@ Defined in: [packages/db/src/types.ts:585](https://github.com/TanStack/db/blob/m value: T; ``` -Defined in: [packages/db/src/types.ts:583](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L583) +Defined in: [packages/db/src/types.ts:605](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L605) diff --git a/docs/reference/interfaces/Collection.md b/docs/reference/interfaces/Collection.md index 0993d74980..a2ead44190 100644 --- a/docs/reference/interfaces/Collection.md +++ b/docs/reference/interfaces/Collection.md @@ -234,7 +234,7 @@ Do not mutate the backing map or its rows: that bypasses publication. get compareOptions(): StringCollationConfig; ``` -Defined in: [packages/db/src/collection/index.ts:913](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L913) +Defined in: [packages/db/src/collection/index.ts:918](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L918) ##### Returns @@ -254,7 +254,7 @@ Defined in: [packages/db/src/collection/index.ts:913](https://github.com/TanStac get indexes(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L898) +Defined in: [packages/db/src/collection/index.ts:903](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L903) Get resolved indexes for query optimization @@ -300,7 +300,7 @@ true if the collection has pending load more operations, false otherwise get size(): number; ``` -Defined in: [packages/db/src/collection/index.ts:763](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L763) +Defined in: [packages/db/src/collection/index.ts:768](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L768) Get the current size of the collection (cached) @@ -322,7 +322,7 @@ Get the current size of the collection (cached) get state(): Map>; ``` -Defined in: [packages/db/src/collection/index.ts:1090](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1090) +Defined in: [packages/db/src/collection/index.ts:1095](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1095) Gets the current state of the collection as a Map @@ -407,7 +407,7 @@ query that has no subscriber or preload of its own does not count. get toArray(): WithVirtualProps[]; ``` -Defined in: [packages/db/src/collection/index.ts:1114](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1114) +Defined in: [packages/db/src/collection/index.ts:1119](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1119) Gets the current state of the collection as an Array @@ -463,6 +463,26 @@ Defined in: [packages/db/src/collection/index.ts:665](https://github.com/TanStac *** +### \_hasHeldSyncTransaction() + +```ts +_hasHeldSyncTransaction(): boolean; +``` + +Defined in: [packages/db/src/collection/index.ts:761](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L761) + +Whether an accepted sync transaction is not yet visible. + +#### Returns + +`boolean` + +#### Inherited from + +[`CollectionImpl`](../classes/CollectionImpl.md).[`_hasHeldSyncTransaction`](../classes/CollectionImpl.md#_hasheldsynctransaction) + +*** + ### \_hasHydratedKey() ```ts @@ -775,7 +795,7 @@ Applied metadata keys without a source row. iterator: IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:801](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L801) +Defined in: [packages/db/src/collection/index.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L806) Get all entries (virtual derived state) @@ -795,7 +815,7 @@ Get all entries (virtual derived state) cleanup(): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1281](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1281) +Defined in: [packages/db/src/collection/index.ts:1286](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1286) Clean up the collection by stopping sync and clearing data This can be called manually or automatically by garbage collection @@ -820,7 +840,7 @@ final cleaned-up state. createIndex(indexCallback, config): BaseIndex; ``` -Defined in: [packages/db/src/collection/index.ts:867](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L867) +Defined in: [packages/db/src/collection/index.ts:872](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L872) Creates an index on a collection for faster queries. Indexes significantly improve query performance by allowing constant time lookups @@ -880,7 +900,7 @@ currentStateAsChanges(options): | ChangeMessage, TKey>[]; ``` -Defined in: [packages/db/src/collection/index.ts:1147](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1147) +Defined in: [packages/db/src/collection/index.ts:1152](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1152) Returns the current state of the collection as an array of changes @@ -928,7 +948,7 @@ const activeChanges = collection.currentStateAsChanges({ delete(keys, config?): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1067](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1067) +Defined in: [packages/db/src/collection/index.ts:1072](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1072) Deletes one or more items from the collection @@ -995,7 +1015,7 @@ try { entries(): IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:789](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L789) +Defined in: [packages/db/src/collection/index.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L794) Get all entries (virtual derived state) @@ -1015,7 +1035,7 @@ Get all entries (virtual derived state) forEach(callbackfn): void; ``` -Defined in: [packages/db/src/collection/index.ts:810](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L810) +Defined in: [packages/db/src/collection/index.ts:815](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L815) Execute a callback for each entry in the collection @@ -1070,7 +1090,7 @@ Get the current value for a key (virtual derived state) getIndexMetadata(): CollectionIndexMetadata[]; ``` -Defined in: [packages/db/src/collection/index.ts:891](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L891) +Defined in: [packages/db/src/collection/index.ts:896](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L896) Returns a snapshot of current index metadata sorted by indexId. Persistence wrappers can use this to bootstrap index state if indexes were @@ -1092,7 +1112,7 @@ created before event listeners were attached. getKeyFromItem(item): TKey; ``` -Defined in: [packages/db/src/collection/index.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L841) +Defined in: [packages/db/src/collection/index.ts:846](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L846) #### Parameters @@ -1144,7 +1164,7 @@ insert(data, config?): | Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:954](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L954) +Defined in: [packages/db/src/collection/index.ts:959](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L959) Inserts one or more items into the collection @@ -1253,7 +1273,7 @@ if (collection.isReady()) { keys(): IterableIterator; ``` -Defined in: [packages/db/src/collection/index.ts:770](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L770) +Defined in: [packages/db/src/collection/index.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L775) Get all keys (virtual derived state) @@ -1273,7 +1293,7 @@ Get all keys (virtual derived state) map(callbackfn): U[]; ``` -Defined in: [packages/db/src/collection/index.ts:826](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L826) +Defined in: [packages/db/src/collection/index.ts:831](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L831) Create a new array with the results of calling a function for each entry in the collection @@ -1305,7 +1325,7 @@ Create a new array with the results of calling a function for each entry in the off(event, callback): void; ``` -Defined in: [packages/db/src/collection/index.ts:1256](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1256) +Defined in: [packages/db/src/collection/index.ts:1261](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1261) Unsubscribe from a collection event @@ -1323,6 +1343,7 @@ Unsubscribe from a collection event \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` @@ -1352,7 +1373,7 @@ Unsubscribe from a collection event on(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1236](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1236) +Defined in: [packages/db/src/collection/index.ts:1241](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1241) Subscribe to a collection event @@ -1370,6 +1391,7 @@ Subscribe to a collection event \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` @@ -1405,7 +1427,7 @@ Subscribe to a collection event once(event, callback): () => void; ``` -Defined in: [packages/db/src/collection/index.ts:1246](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1246) +Defined in: [packages/db/src/collection/index.ts:1251](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1251) Subscribe to a collection event once @@ -1423,6 +1445,7 @@ Subscribe to a collection event once \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` @@ -1528,7 +1551,7 @@ Multiple concurrent calls will share the same promise removeIndex(indexOrId): boolean; ``` -Defined in: [packages/db/src/collection/index.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L882) +Defined in: [packages/db/src/collection/index.ts:887](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L887) Removes an index created with createIndex. Returns true when an index existed and was removed. @@ -1581,7 +1604,7 @@ Throws during active cleanup; restart after cleanup completes instead. stateWhenReady(): Promise>>; ``` -Defined in: [packages/db/src/collection/index.ts:1105](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1105) +Defined in: [packages/db/src/collection/index.ts:1110](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1110) Gets the current state of the collection as a Map once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1607,7 +1630,7 @@ Promise that resolves to a Map containing all items in the collection subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1199](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1199) +Defined in: [packages/db/src/collection/index.ts:1204](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1204) Subscribe to changes in the collection Changes to the same key retain their causal order within a callback. @@ -1686,7 +1709,7 @@ const subscription = collection.subscribeChanges((changes) => { subscribeChanges(callback, options?): CollectionSubscription; ``` -Defined in: [packages/db/src/collection/index.ts:1207](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1207) +Defined in: [packages/db/src/collection/index.ts:1212](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1212) Subscribe to changes in the collection Changes to the same key retain their causal order within a callback. @@ -1767,7 +1790,7 @@ const subscription = collection.subscribeChanges((changes) => { toArrayWhenReady(): Promise[]>; ``` -Defined in: [packages/db/src/collection/index.ts:1125](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1125) +Defined in: [packages/db/src/collection/index.ts:1130](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1130) Gets the current state of the collection as an Array once the collection is ready Resolves when `preload()` does. For a live query, that is initial-query @@ -1793,7 +1816,7 @@ Promise that resolves to an Array containing all items in the collection update(key, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:999](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L999) +Defined in: [packages/db/src/collection/index.ts:1004](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1004) Updates one or more items in the collection using a callback function @@ -1868,7 +1891,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1005](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1005) +Defined in: [packages/db/src/collection/index.ts:1010](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1010) Updates one or more items in the collection using a callback function @@ -1946,7 +1969,7 @@ try { update(id, callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1012](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1012) +Defined in: [packages/db/src/collection/index.ts:1017](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1017) Updates one or more items in the collection using a callback function @@ -2021,7 +2044,7 @@ update( callback): Transaction; ``` -Defined in: [packages/db/src/collection/index.ts:1018](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1018) +Defined in: [packages/db/src/collection/index.ts:1023](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1023) Updates one or more items in the collection using a callback function @@ -2102,7 +2125,7 @@ validateData( key?): T; ``` -Defined in: [packages/db/src/collection/index.ts:905](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L905) +Defined in: [packages/db/src/collection/index.ts:910](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L910) Validates the data against the schema @@ -2136,7 +2159,7 @@ Validates the data against the schema values(): IterableIterator>; ``` -Defined in: [packages/db/src/collection/index.ts:777](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L777) +Defined in: [packages/db/src/collection/index.ts:782](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L782) Get all values (virtual derived state) @@ -2156,7 +2179,7 @@ Get all values (virtual derived state) waitFor(event, timeout?): Promise; ``` -Defined in: [packages/db/src/collection/index.ts:1266](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1266) +Defined in: [packages/db/src/collection/index.ts:1271](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L1271) Wait for a collection event @@ -2174,6 +2197,7 @@ Wait for a collection event \| `"subscribers:change"` \| `"loadingSubset:change"` \| `"truncate"` + \| `"loadedSubsets:invalidated"` \| `"index:added"` \| `"index:removed"` diff --git a/docs/reference/interfaces/CollectionConfig.md b/docs/reference/interfaces/CollectionConfig.md index b6052ab32e..79b36c3d82 100644 --- a/docs/reference/interfaces/CollectionConfig.md +++ b/docs/reference/interfaces/CollectionConfig.md @@ -3,7 +3,7 @@ id: CollectionConfig title: CollectionConfig --- -Defined in: [packages/db/src/types.ts:1019](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1019) +Defined in: [packages/db/src/types.ts:1041](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1041) ## Extends @@ -35,7 +35,7 @@ Defined in: [packages/db/src/types.ts:1019](https://github.com/TanStack/db/blob/ optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L794) +Defined in: [packages/db/src/types.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L816) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -64,7 +64,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:819](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L819) +Defined in: [packages/db/src/types.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L841) Optional function to compare two items. This is used to order the items in the collection. @@ -108,7 +108,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:808](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L808) +Defined in: [packages/db/src/types.ts:830](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L830) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -136,7 +136,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1014) +Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -155,7 +155,7 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L773) +Defined in: [packages/db/src/types.ts:795](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L795) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). @@ -176,7 +176,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:764](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L764) +Defined in: [packages/db/src/types.ts:786](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L786) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -214,7 +214,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L753) +Defined in: [packages/db/src/types.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L775) #### Inherited from @@ -230,7 +230,7 @@ optional onDelete: | DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1003](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1003) +Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1025) Optional asynchronous handler function called before a delete operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -307,7 +307,7 @@ optional onInsert: | InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L882) +Defined in: [packages/db/src/types.ts:904](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L904) Optional asynchronous handler function called before an insert operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -382,7 +382,7 @@ optional onUpdate: | UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:944](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L944) +Defined in: [packages/db/src/types.ts:966](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L966) Optional asynchronous handler function called before an update operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -459,7 +459,7 @@ onUpdate: async ({ transaction, collection }) => { optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L754) +Defined in: [packages/db/src/types.ts:776](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L776) #### Inherited from @@ -473,7 +473,7 @@ Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:784](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L784) +Defined in: [packages/db/src/types.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L806) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -500,7 +500,7 @@ false sync: SyncConfig; ``` -Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1025) +Defined in: [packages/db/src/types.ts:1047](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1047) *** @@ -510,7 +510,7 @@ Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/ optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) +Defined in: [packages/db/src/types.ts:850](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L850) The mode of sync to use for the collection. @@ -536,7 +536,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: TUtils; ``` -Defined in: [packages/db/src/types.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1016) +Defined in: [packages/db/src/types.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1038) #### Inherited from diff --git a/docs/reference/interfaces/CollectionIndexMetadata.md b/docs/reference/interfaces/CollectionIndexMetadata.md index 87f3d81db1..1c2c1aed14 100644 --- a/docs/reference/interfaces/CollectionIndexMetadata.md +++ b/docs/reference/interfaces/CollectionIndexMetadata.md @@ -3,7 +3,7 @@ id: CollectionIndexMetadata title: CollectionIndexMetadata --- -Defined in: [packages/db/src/collection/events.ts:71](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L71) +Defined in: [packages/db/src/collection/events.ts:81](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L81) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/collection/events.ts:71](https://github.com/TanStac expression: BasicExpression; ``` -Defined in: [packages/db/src/collection/events.ts:83](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L83) +Defined in: [packages/db/src/collection/events.ts:93](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L93) *** @@ -23,7 +23,7 @@ Defined in: [packages/db/src/collection/events.ts:83](https://github.com/TanStac indexId: number; ``` -Defined in: [packages/db/src/collection/events.ts:81](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L81) +Defined in: [packages/db/src/collection/events.ts:91](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L91) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/collection/events.ts:81](https://github.com/TanStac optional name: string; ``` -Defined in: [packages/db/src/collection/events.ts:82](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L82) +Defined in: [packages/db/src/collection/events.ts:92](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L92) *** @@ -43,7 +43,7 @@ Defined in: [packages/db/src/collection/events.ts:82](https://github.com/TanStac optional options: CollectionIndexSerializableValue; ``` -Defined in: [packages/db/src/collection/events.ts:85](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L85) +Defined in: [packages/db/src/collection/events.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L95) *** @@ -53,7 +53,7 @@ Defined in: [packages/db/src/collection/events.ts:85](https://github.com/TanStac resolver: CollectionIndexResolverMetadata; ``` -Defined in: [packages/db/src/collection/events.ts:84](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L84) +Defined in: [packages/db/src/collection/events.ts:94](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L94) *** @@ -63,7 +63,7 @@ Defined in: [packages/db/src/collection/events.ts:84](https://github.com/TanStac signature: string; ``` -Defined in: [packages/db/src/collection/events.ts:80](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L80) +Defined in: [packages/db/src/collection/events.ts:90](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L90) Stable signature derived from expression + serializable options. Non-serializable option fields are intentionally omitted. @@ -76,6 +76,6 @@ Non-serializable option fields are intentionally omitted. signatureVersion: 1; ``` -Defined in: [packages/db/src/collection/events.ts:75](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L75) +Defined in: [packages/db/src/collection/events.ts:85](https://github.com/TanStack/db/blob/main/packages/db/src/collection/events.ts#L85) Version for the signature serialization contract. diff --git a/docs/reference/interfaces/CollectionLike.md b/docs/reference/interfaces/CollectionLike.md index eecf9ee457..c1bcd76359 100644 --- a/docs/reference/interfaces/CollectionLike.md +++ b/docs/reference/interfaces/CollectionLike.md @@ -30,7 +30,7 @@ for the change events system to work compareOptions: StringCollationConfig; ``` -Defined in: [packages/db/src/collection/index.ts:913](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L913) +Defined in: [packages/db/src/collection/index.ts:918](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L918) #### Inherited from @@ -58,7 +58,7 @@ Defined in: [packages/db/src/collection/index.ts:401](https://github.com/TanStac indexes: Map>; ``` -Defined in: [packages/db/src/collection/index.ts:898](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L898) +Defined in: [packages/db/src/collection/index.ts:903](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L903) #### Inherited from @@ -74,7 +74,7 @@ Pick.indexes entries(): IterableIterator<[TKey, WithVirtualProps]>; ``` -Defined in: [packages/db/src/collection/index.ts:789](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L789) +Defined in: [packages/db/src/collection/index.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/collection/index.ts#L794) Get all entries (virtual derived state) diff --git a/docs/reference/interfaces/CreateIndexedDBOptions.md b/docs/reference/interfaces/CreateIndexedDBOptions.md index fe98473e3d..3d5d39268c 100644 --- a/docs/reference/interfaces/CreateIndexedDBOptions.md +++ b/docs/reference/interfaces/CreateIndexedDBOptions.md @@ -3,7 +3,7 @@ id: CreateIndexedDBOptions title: CreateIndexedDBOptions --- -Defined in: [packages/db/src/indexed-db.ts:95](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L95) +Defined in: [packages/db/src/indexed-db.ts:99](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L99) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/indexed-db.ts:95](https://github.com/TanStack/db/bl optional idbFactory: IDBFactory; ``` -Defined in: [packages/db/src/indexed-db.ts:103](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L103) +Defined in: [packages/db/src/indexed-db.ts:107](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L107) Custom IDBFactory for testing/mocking @@ -25,7 +25,7 @@ Custom IDBFactory for testing/mocking name: string; ``` -Defined in: [packages/db/src/indexed-db.ts:97](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L97) +Defined in: [packages/db/src/indexed-db.ts:101](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L101) Database name @@ -37,7 +37,7 @@ Database name optional onBlocked: (event) => void; ``` -Defined in: [packages/db/src/indexed-db.ts:105](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L105) +Defined in: [packages/db/src/indexed-db.ts:109](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L109) Reports a native blocker without settling the open request. @@ -59,7 +59,7 @@ Reports a native blocker without settling the open request. stores: readonly string[]; ``` -Defined in: [packages/db/src/indexed-db.ts:101](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L101) +Defined in: [packages/db/src/indexed-db.ts:105](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L105) Object store names to create @@ -71,6 +71,6 @@ Object store names to create version: number; ``` -Defined in: [packages/db/src/indexed-db.ts:99](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L99) +Defined in: [packages/db/src/indexed-db.ts:103](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L103) Schema version (increment when adding stores) diff --git a/docs/reference/interfaces/CurrentStateAsChangesOptions.md b/docs/reference/interfaces/CurrentStateAsChangesOptions.md index 57662284a4..f106906d28 100644 --- a/docs/reference/interfaces/CurrentStateAsChangesOptions.md +++ b/docs/reference/interfaces/CurrentStateAsChangesOptions.md @@ -3,7 +3,7 @@ id: CurrentStateAsChangesOptions title: CurrentStateAsChangesOptions --- -Defined in: [packages/db/src/types.ts:1168](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1168) +Defined in: [packages/db/src/types.ts:1190](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1190) Options for getting current state as changes @@ -15,7 +15,7 @@ Options for getting current state as changes optional limit: number; ``` -Defined in: [packages/db/src/types.ts:1172](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1172) +Defined in: [packages/db/src/types.ts:1194](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1194) *** @@ -25,7 +25,7 @@ Defined in: [packages/db/src/types.ts:1172](https://github.com/TanStack/db/blob/ optional optimizedOnly: boolean; ``` -Defined in: [packages/db/src/types.ts:1173](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1173) +Defined in: [packages/db/src/types.ts:1195](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1195) *** @@ -35,7 +35,7 @@ Defined in: [packages/db/src/types.ts:1173](https://github.com/TanStack/db/blob/ optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:1171](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1171) +Defined in: [packages/db/src/types.ts:1193](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1193) *** @@ -45,6 +45,6 @@ Defined in: [packages/db/src/types.ts:1171](https://github.com/TanStack/db/blob/ optional where: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:1170](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1170) +Defined in: [packages/db/src/types.ts:1192](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1192) Pre-compiled expression for filtering the current state diff --git a/docs/reference/interfaces/DatabaseInfo.md b/docs/reference/interfaces/DatabaseInfo.md index a6a2c8a76d..2e2e57044b 100644 --- a/docs/reference/interfaces/DatabaseInfo.md +++ b/docs/reference/interfaces/DatabaseInfo.md @@ -3,7 +3,7 @@ id: DatabaseInfo title: DatabaseInfo --- -Defined in: [packages/db/src/indexed-db.ts:204](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L204) +Defined in: [packages/db/src/indexed-db.ts:208](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L208) Database information returned by getDatabaseInfo() @@ -15,7 +15,7 @@ Database information returned by getDatabaseInfo() optional estimatedSize: number; ``` -Defined in: [packages/db/src/indexed-db.ts:209](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L209) +Defined in: [packages/db/src/indexed-db.ts:213](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L213) Origin-wide storage usage in bytes, including other databases and caches. @@ -27,7 +27,7 @@ Origin-wide storage usage in bytes, including other databases and caches. name: string; ``` -Defined in: [packages/db/src/indexed-db.ts:205](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L205) +Defined in: [packages/db/src/indexed-db.ts:209](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L209) *** @@ -37,7 +37,7 @@ Defined in: [packages/db/src/indexed-db.ts:205](https://github.com/TanStack/db/b objectStores: string[]; ``` -Defined in: [packages/db/src/indexed-db.ts:207](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L207) +Defined in: [packages/db/src/indexed-db.ts:211](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L211) *** @@ -47,4 +47,4 @@ Defined in: [packages/db/src/indexed-db.ts:207](https://github.com/TanStack/db/b version: number; ``` -Defined in: [packages/db/src/indexed-db.ts:206](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L206) +Defined in: [packages/db/src/indexed-db.ts:210](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L210) diff --git a/docs/reference/interfaces/IndexedDBCollectionConfig.md b/docs/reference/interfaces/IndexedDBCollectionConfig.md index a5e0fd0dec..19af11fc04 100644 --- a/docs/reference/interfaces/IndexedDBCollectionConfig.md +++ b/docs/reference/interfaces/IndexedDBCollectionConfig.md @@ -3,7 +3,7 @@ id: IndexedDBCollectionConfig title: IndexedDBCollectionConfig --- -Defined in: [packages/db/src/indexed-db.ts:145](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L145) +Defined in: [packages/db/src/indexed-db.ts:149](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L149) Configuration options for creating an IndexedDB Collection @@ -33,7 +33,7 @@ Configuration options for creating an IndexedDB Collection optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L794) +Defined in: [packages/db/src/types.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L816) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -62,7 +62,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:819](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L819) +Defined in: [packages/db/src/types.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L841) Optional function to compare two items. This is used to order the items in the collection. @@ -106,7 +106,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() db: IndexedDBInstance; ``` -Defined in: [packages/db/src/indexed-db.ts:154](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L154) +Defined in: [packages/db/src/indexed-db.ts:158](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L158) IndexedDB instance from createIndexedDB() REQUIRED - must create database before collections @@ -119,7 +119,7 @@ REQUIRED - must create database before collections optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:808](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L808) +Defined in: [packages/db/src/types.ts:830](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L830) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -147,7 +147,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1014) +Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -166,7 +166,7 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L773) +Defined in: [packages/db/src/types.ts:795](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L795) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). @@ -187,7 +187,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:764](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L764) +Defined in: [packages/db/src/types.ts:786](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L786) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -225,7 +225,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L753) +Defined in: [packages/db/src/types.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L775) #### Inherited from @@ -239,7 +239,7 @@ Defined in: [packages/db/src/types.ts:753](https://github.com/TanStack/db/blob/m name: string; ``` -Defined in: [packages/db/src/indexed-db.ts:160](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L160) +Defined in: [packages/db/src/indexed-db.ts:164](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L164) Name of the object store within the database Must exist in the underlying database @@ -254,7 +254,7 @@ optional onDelete: | DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1003](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1003) +Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1025) Optional asynchronous handler function called before a delete operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -331,7 +331,7 @@ optional onInsert: | InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L882) +Defined in: [packages/db/src/types.ts:904](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L904) Optional asynchronous handler function called before an insert operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -406,7 +406,7 @@ optional onUpdate: | UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:944](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L944) +Defined in: [packages/db/src/types.ts:966](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L966) Optional asynchronous handler function called before an update operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -483,7 +483,7 @@ onUpdate: async ({ transaction, collection }) => { optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L754) +Defined in: [packages/db/src/types.ts:776](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L776) #### Inherited from @@ -497,7 +497,7 @@ Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:784](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L784) +Defined in: [packages/db/src/types.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L806) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -524,7 +524,7 @@ false optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) +Defined in: [packages/db/src/types.ts:850](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L850) The mode of sync to use for the collection. @@ -550,7 +550,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: UtilsRecord; ``` -Defined in: [packages/db/src/types.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1016) +Defined in: [packages/db/src/types.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1038) #### Inherited from diff --git a/docs/reference/interfaces/IndexedDBCollectionUtils.md b/docs/reference/interfaces/IndexedDBCollectionUtils.md index e374d66d84..ea8379d476 100644 --- a/docs/reference/interfaces/IndexedDBCollectionUtils.md +++ b/docs/reference/interfaces/IndexedDBCollectionUtils.md @@ -3,7 +3,7 @@ id: IndexedDBCollectionUtils title: IndexedDBCollectionUtils --- -Defined in: [packages/db/src/indexed-db.ts:215](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L215) +Defined in: [packages/db/src/indexed-db.ts:219](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L219) Utility functions exposed on collection.utils @@ -35,7 +35,7 @@ Utility functions exposed on collection.utils acceptMutations: (transaction) => Promise; ``` -Defined in: [packages/db/src/indexed-db.ts:233](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L233) +Defined in: [packages/db/src/indexed-db.ts:237](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L237) Accepts mutations from a manual transaction and persists to IndexedDB @@ -59,7 +59,7 @@ Accepts mutations from a manual transaction and persists to IndexedDB clearObjectStore: () => Promise; ``` -Defined in: [packages/db/src/indexed-db.ts:223](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L223) +Defined in: [packages/db/src/indexed-db.ts:227](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L227) Removes all data from the object store Does NOT delete the database itself @@ -76,7 +76,7 @@ Does NOT delete the database itself exportData: () => Promise; ``` -Defined in: [packages/db/src/indexed-db.ts:241](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L241) +Defined in: [packages/db/src/indexed-db.ts:245](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L245) Exports all data from the object store as an array Useful for backup/debugging @@ -93,7 +93,7 @@ Useful for backup/debugging getDatabaseInfo: () => Promise; ``` -Defined in: [packages/db/src/indexed-db.ts:228](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L228) +Defined in: [packages/db/src/indexed-db.ts:232](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L232) Returns database information for debugging @@ -109,7 +109,7 @@ Returns database information for debugging importData: (items) => Promise; ``` -Defined in: [packages/db/src/indexed-db.ts:247](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L247) +Defined in: [packages/db/src/indexed-db.ts:251](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L251) Validates input rows and atomically replaces the object store. Failure preserves the previous rows and versions. diff --git a/docs/reference/interfaces/IndexedDBInstance.md b/docs/reference/interfaces/IndexedDBInstance.md index 58d38ffc40..4effe2c100 100644 --- a/docs/reference/interfaces/IndexedDBInstance.md +++ b/docs/reference/interfaces/IndexedDBInstance.md @@ -3,7 +3,7 @@ id: IndexedDBInstance title: IndexedDBInstance --- -Defined in: [packages/db/src/indexed-db.ts:112](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L112) +Defined in: [packages/db/src/indexed-db.ts:116](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L116) A shared IndexedDB database instance. Create with createIndexedDB() and pass to collections. @@ -16,7 +16,7 @@ Create with createIndexedDB() and pass to collections. close: () => void; ``` -Defined in: [packages/db/src/indexed-db.ts:124](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L124) +Defined in: [packages/db/src/indexed-db.ts:128](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L128) Close the connection and mark its managed Collections as errored. @@ -32,7 +32,7 @@ Close the connection and mark its managed Collections as errored. readonly db: IDBDatabase; ``` -Defined in: [packages/db/src/indexed-db.ts:114](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L114) +Defined in: [packages/db/src/indexed-db.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L118) The underlying IDBDatabase connection @@ -44,7 +44,7 @@ The underlying IDBDatabase connection readonly optional idbFactory: IDBFactory; ``` -Defined in: [packages/db/src/indexed-db.ts:122](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L122) +Defined in: [packages/db/src/indexed-db.ts:126](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L126) IDBFactory used to create this database (for testing) @@ -56,7 +56,7 @@ IDBFactory used to create this database (for testing) readonly name: string; ``` -Defined in: [packages/db/src/indexed-db.ts:116](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L116) +Defined in: [packages/db/src/indexed-db.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L120) Database name @@ -68,7 +68,7 @@ Database name readonly stores: readonly string[]; ``` -Defined in: [packages/db/src/indexed-db.ts:120](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L120) +Defined in: [packages/db/src/indexed-db.ts:124](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L124) Requested object store names (frozen); omissions do not remove stores @@ -80,6 +80,6 @@ Requested object store names (frozen); omissions do not remove stores readonly version: number; ``` -Defined in: [packages/db/src/indexed-db.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L118) +Defined in: [packages/db/src/indexed-db.ts:122](https://github.com/TanStack/db/blob/main/packages/db/src/indexed-db.ts#L122) Database version diff --git a/docs/reference/interfaces/InsertConfig.md b/docs/reference/interfaces/InsertConfig.md index 034154da11..b889553c85 100644 --- a/docs/reference/interfaces/InsertConfig.md +++ b/docs/reference/interfaces/InsertConfig.md @@ -3,7 +3,7 @@ id: InsertConfig title: InsertConfig --- -Defined in: [packages/db/src/types.ts:636](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L636) +Defined in: [packages/db/src/types.ts:658](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L658) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/types.ts:636](https://github.com/TanStack/db/blob/m optional metadata: Record; ``` -Defined in: [packages/db/src/types.ts:637](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L637) +Defined in: [packages/db/src/types.ts:659](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L659) *** @@ -23,6 +23,6 @@ Defined in: [packages/db/src/types.ts:637](https://github.com/TanStack/db/blob/m optional optimistic: boolean; ``` -Defined in: [packages/db/src/types.ts:639](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L639) +Defined in: [packages/db/src/types.ts:661](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L661) Whether to apply optimistic updates immediately. Defaults to true. diff --git a/docs/reference/interfaces/LocalOnlyCollectionConfig.md b/docs/reference/interfaces/LocalOnlyCollectionConfig.md index e19c72208f..8b35cf2644 100644 --- a/docs/reference/interfaces/LocalOnlyCollectionConfig.md +++ b/docs/reference/interfaces/LocalOnlyCollectionConfig.md @@ -39,7 +39,7 @@ The type of the key returned by `getKey` optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L794) +Defined in: [packages/db/src/types.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L816) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -68,7 +68,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:819](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L819) +Defined in: [packages/db/src/types.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L841) Optional function to compare two items. This is used to order the items in the collection. @@ -114,7 +114,7 @@ Omit.compare optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:808](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L808) +Defined in: [packages/db/src/types.ts:830](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L830) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -144,7 +144,7 @@ Omit.defaultIndexType optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1014) +Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -165,7 +165,7 @@ Omit.defaultStringCollation getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:764](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L764) +Defined in: [packages/db/src/types.ts:786](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L786) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -205,7 +205,7 @@ Omit.getKey optional id: string; ``` -Defined in: [packages/db/src/types.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L753) +Defined in: [packages/db/src/types.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L775) #### Inherited from @@ -234,7 +234,7 @@ optional onDelete: | DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1003](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1003) +Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1025) Optional asynchronous handler function called before a delete operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -313,7 +313,7 @@ optional onInsert: | InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L882) +Defined in: [packages/db/src/types.ts:904](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L904) Optional asynchronous handler function called before an insert operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -390,7 +390,7 @@ optional onUpdate: | UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:944](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L944) +Defined in: [packages/db/src/types.ts:966](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L966) Optional asynchronous handler function called before an update operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -469,7 +469,7 @@ Omit.onUpdate optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L754) +Defined in: [packages/db/src/types.ts:776](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L776) #### Inherited from @@ -485,7 +485,7 @@ Omit.schema optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) +Defined in: [packages/db/src/types.ts:850](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L850) The mode of sync to use for the collection. @@ -511,7 +511,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: LocalOnlyCollectionUtils; ``` -Defined in: [packages/db/src/types.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1016) +Defined in: [packages/db/src/types.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1038) #### Inherited from diff --git a/docs/reference/interfaces/LocalStorageCollectionConfig.md b/docs/reference/interfaces/LocalStorageCollectionConfig.md index 95f8f31bae..19aeed6b26 100644 --- a/docs/reference/interfaces/LocalStorageCollectionConfig.md +++ b/docs/reference/interfaces/LocalStorageCollectionConfig.md @@ -39,7 +39,7 @@ The type of the key returned by `getKey` optional autoIndex: "eager" | "off"; ``` -Defined in: [packages/db/src/types.ts:794](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L794) +Defined in: [packages/db/src/types.ts:816](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L816) Auto-indexing mode for the collection. When enabled, indexes will be automatically created for simple where expressions. @@ -68,7 +68,7 @@ When enabled, indexes will be automatically created for simple where expressions optional compare: (x, y) => number; ``` -Defined in: [packages/db/src/types.ts:819](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L819) +Defined in: [packages/db/src/types.ts:841](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L841) Optional function to compare two items. This is used to order the items in the collection. @@ -112,7 +112,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime() optional defaultIndexType: IndexConstructor; ``` -Defined in: [packages/db/src/types.ts:808](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L808) +Defined in: [packages/db/src/types.ts:830](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L830) Default index type to use when creating indexes without an explicit type. Required for auto-indexing. Import from '@tanstack/db'. @@ -140,7 +140,7 @@ const collection = createCollection({ optional defaultStringCollation: StringCollationConfig; ``` -Defined in: [packages/db/src/types.ts:1014](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1014) +Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) Specifies how to compare data in the collection. This should be configured to match data ordering on the backend. @@ -159,7 +159,7 @@ E.g., when using the Electric DB collection these options optional gcTime: number; ``` -Defined in: [packages/db/src/types.ts:773](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L773) +Defined in: [packages/db/src/types.ts:795](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L795) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). @@ -180,7 +180,7 @@ disables automatic garbage collection. getKey: (item) => TKey; ``` -Defined in: [packages/db/src/types.ts:764](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L764) +Defined in: [packages/db/src/types.ts:786](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L786) Function to extract the ID from an object This is required for update/delete operations which now only accept IDs @@ -218,7 +218,7 @@ getKey: (item) => item.uuid optional id: string; ``` -Defined in: [packages/db/src/types.ts:753](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L753) +Defined in: [packages/db/src/types.ts:775](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L775) #### Inherited from @@ -234,7 +234,7 @@ optional onDelete: | DeleteMutationFn; ``` -Defined in: [packages/db/src/types.ts:1003](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1003) +Defined in: [packages/db/src/types.ts:1025](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1025) Optional asynchronous handler function called before a delete operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -311,7 +311,7 @@ optional onInsert: | InsertMutationFn; ``` -Defined in: [packages/db/src/types.ts:882](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L882) +Defined in: [packages/db/src/types.ts:904](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L904) Optional asynchronous handler function called before an insert operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -386,7 +386,7 @@ optional onUpdate: | UpdateMutationFn; ``` -Defined in: [packages/db/src/types.ts:944](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L944) +Defined in: [packages/db/src/types.ts:966](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L966) Optional asynchronous handler function called before an update operation Returning a value is deprecated; coordinate synchronization through collection utilities instead. @@ -476,7 +476,7 @@ Defaults to JSON optional schema: TSchema; ``` -Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L754) +Defined in: [packages/db/src/types.ts:776](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L776) #### Inherited from @@ -490,7 +490,7 @@ Defined in: [packages/db/src/types.ts:754](https://github.com/TanStack/db/blob/m optional startSync: boolean; ``` -Defined in: [packages/db/src/types.ts:784](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L784) +Defined in: [packages/db/src/types.ts:806](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L806) Whether to eagerly start syncing on collection creation. When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches. @@ -555,7 +555,7 @@ The key to use for storing the collection data in localStorage/sessionStorage optional syncMode: SyncMode; ``` -Defined in: [packages/db/src/types.ts:828](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L828) +Defined in: [packages/db/src/types.ts:850](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L850) The mode of sync to use for the collection. @@ -581,7 +581,7 @@ The exact implementation of the sync mode is up to the sync implementation. optional utils: UtilsRecord; ``` -Defined in: [packages/db/src/types.ts:1016](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1016) +Defined in: [packages/db/src/types.ts:1038](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1038) #### Inherited from diff --git a/docs/reference/interfaces/OperationConfig.md b/docs/reference/interfaces/OperationConfig.md index 4db46c6c9a..3f1d8b4150 100644 --- a/docs/reference/interfaces/OperationConfig.md +++ b/docs/reference/interfaces/OperationConfig.md @@ -3,7 +3,7 @@ id: OperationConfig title: OperationConfig --- -Defined in: [packages/db/src/types.ts:630](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L630) +Defined in: [packages/db/src/types.ts:652](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L652) ## Properties @@ -13,7 +13,7 @@ Defined in: [packages/db/src/types.ts:630](https://github.com/TanStack/db/blob/m optional metadata: Record; ``` -Defined in: [packages/db/src/types.ts:631](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L631) +Defined in: [packages/db/src/types.ts:653](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L653) *** @@ -23,6 +23,6 @@ Defined in: [packages/db/src/types.ts:631](https://github.com/TanStack/db/blob/m optional optimistic: boolean; ``` -Defined in: [packages/db/src/types.ts:633](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L633) +Defined in: [packages/db/src/types.ts:655](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L655) Whether to apply optimistic updates immediately. Defaults to true. diff --git a/docs/reference/interfaces/SubscribeChangesOptions.md b/docs/reference/interfaces/SubscribeChangesOptions.md index 6f37dcf9fb..d3fb770e49 100644 --- a/docs/reference/interfaces/SubscribeChangesOptions.md +++ b/docs/reference/interfaces/SubscribeChangesOptions.md @@ -3,7 +3,7 @@ id: SubscribeChangesOptions title: SubscribeChangesOptions --- -Defined in: [packages/db/src/types.ts:1094](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1094) +Defined in: [packages/db/src/types.ts:1116](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1116) Options for subscribing to collection changes @@ -25,7 +25,7 @@ Options for subscribing to collection changes optional deferAcquisition: boolean; ``` -Defined in: [packages/db/src/types.ts:1125](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1125) +Defined in: [packages/db/src/types.ts:1147](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1147) **`Internal`** @@ -43,7 +43,7 @@ subscriber or a preload in its current sync run. optional includeInitialState: boolean; ``` -Defined in: [packages/db/src/types.ts:1099](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1099) +Defined in: [packages/db/src/types.ts:1121](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1121) Whether to include the current state as initial changes @@ -55,7 +55,7 @@ Whether to include the current state as initial changes optional limit: number; ``` -Defined in: [packages/db/src/types.ts:1141](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1141) +Defined in: [packages/db/src/types.ts:1163](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1163) **`Internal`** @@ -69,7 +69,7 @@ Optional limit to include in loadSubset for query-specific cache keys. optional onLoadSubsetError: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1149](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1149) +Defined in: [packages/db/src/types.ts:1171](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1171) **`Internal`** @@ -93,7 +93,7 @@ Receives subset-load failures scoped to this subscription. optional onLoadSubsetResult: (result) => void; ``` -Defined in: [packages/db/src/types.ts:1147](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1147) +Defined in: [packages/db/src/types.ts:1169](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1169) **`Internal`** @@ -118,7 +118,7 @@ Allows the caller to directly track the loading promise for isReady status. optional onStatusChange: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1131) +Defined in: [packages/db/src/types.ts:1153](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1153) **`Internal`** @@ -143,7 +143,7 @@ Registered BEFORE any snapshot is requested, ensuring no status transitions are optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:1136](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1136) +Defined in: [packages/db/src/types.ts:1158](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1158) **`Internal`** @@ -157,7 +157,7 @@ Optional orderBy to include in loadSubset for query-specific cache keys. optional truncateReplayPublication: object; ``` -Defined in: [packages/db/src/types.ts:1151](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1151) +Defined in: [packages/db/src/types.ts:1173](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1173) **`Internal`** @@ -191,7 +191,7 @@ readonly succeed: () => void; optional where: (row) => any; ``` -Defined in: [packages/db/src/types.ts:1114](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1114) +Defined in: [packages/db/src/types.ts:1136](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1136) Callback function for filtering changes using a row proxy. The callback receives a proxy object that records property access, @@ -225,6 +225,6 @@ collection.subscribeChanges(callback, { optional whereExpression: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:1116](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1116) +Defined in: [packages/db/src/types.ts:1138](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1138) Pre-compiled expression for filtering changes diff --git a/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md b/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md index fac0045734..c7c8499e9b 100644 --- a/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md +++ b/docs/reference/interfaces/SubscribeChangesSnapshotOptions.md @@ -3,7 +3,7 @@ id: SubscribeChangesSnapshotOptions title: SubscribeChangesSnapshotOptions --- -Defined in: [packages/db/src/types.ts:1157](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1157) +Defined in: [packages/db/src/types.ts:1179](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1179) ## Extends @@ -27,7 +27,7 @@ Defined in: [packages/db/src/types.ts:1157](https://github.com/TanStack/db/blob/ optional deferAcquisition: boolean; ``` -Defined in: [packages/db/src/types.ts:1125](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1125) +Defined in: [packages/db/src/types.ts:1147](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1147) **`Internal`** @@ -49,7 +49,7 @@ subscriber or a preload in its current sync run. optional limit: number; ``` -Defined in: [packages/db/src/types.ts:1162](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1162) +Defined in: [packages/db/src/types.ts:1184](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1184) **`Internal`** @@ -67,7 +67,7 @@ Optional limit to include in loadSubset for query-specific cache keys. optional onLoadSubsetError: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1149](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1149) +Defined in: [packages/db/src/types.ts:1171](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1171) **`Internal`** @@ -97,7 +97,7 @@ Omit.onLoadSubsetError optional onLoadSubsetResult: (result) => void; ``` -Defined in: [packages/db/src/types.ts:1147](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1147) +Defined in: [packages/db/src/types.ts:1169](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1169) **`Internal`** @@ -128,7 +128,7 @@ Omit.onLoadSubsetResult optional onStatusChange: (event) => void; ``` -Defined in: [packages/db/src/types.ts:1131](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1131) +Defined in: [packages/db/src/types.ts:1153](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1153) **`Internal`** @@ -159,7 +159,7 @@ Omit.onStatusChange optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:1161](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1161) +Defined in: [packages/db/src/types.ts:1183](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1183) **`Internal`** @@ -177,7 +177,7 @@ Optional orderBy to include in loadSubset for query-specific cache keys. optional truncateReplayPublication: object; ``` -Defined in: [packages/db/src/types.ts:1151](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1151) +Defined in: [packages/db/src/types.ts:1173](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1173) **`Internal`** @@ -217,7 +217,7 @@ Omit.truncateReplayPublication optional where: (row) => any; ``` -Defined in: [packages/db/src/types.ts:1114](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1114) +Defined in: [packages/db/src/types.ts:1136](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1136) Callback function for filtering changes using a row proxy. The callback receives a proxy object that records property access, @@ -257,7 +257,7 @@ Omit.where optional whereExpression: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:1116](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1116) +Defined in: [packages/db/src/types.ts:1138](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1138) Pre-compiled expression for filtering changes diff --git a/docs/reference/interfaces/SyncConfig.md b/docs/reference/interfaces/SyncConfig.md index 3af0274b6c..c8ed810d0c 100644 --- a/docs/reference/interfaces/SyncConfig.md +++ b/docs/reference/interfaces/SyncConfig.md @@ -3,7 +3,7 @@ id: SyncConfig title: SyncConfig --- -Defined in: [packages/db/src/types.ts:431](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L431) +Defined in: [packages/db/src/types.ts:445](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L445) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/types.ts:431](https://github.com/TanStack/db/blob/m optional exportSyncMeta: () => unknown; ``` -Defined in: [packages/db/src/types.ts:478](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L478) +Defined in: [packages/db/src/types.ts:500](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L500) Export adapter-specific metadata that lets hydration/persistence resume sync. The payload shape is owned by the adapter. @@ -40,7 +40,7 @@ The payload shape is owned by the adapter. optional getSyncMetadata: () => Record; ``` -Defined in: [packages/db/src/types.ts:472](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L472) +Defined in: [packages/db/src/types.ts:494](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L494) Get the sync metadata for insert operations @@ -58,7 +58,7 @@ Record containing relation information optional importSyncMeta: (meta) => void; ``` -Defined in: [packages/db/src/types.ts:483](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L483) +Defined in: [packages/db/src/types.ts:505](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L505) Import adapter-specific metadata produced by exportSyncMeta. @@ -80,7 +80,7 @@ Import adapter-specific metadata produced by exportSyncMeta. optional mergeSyncMeta: (current, incoming) => unknown; ``` -Defined in: [packages/db/src/types.ts:488](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L488) +Defined in: [packages/db/src/types.ts:510](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L510) Merge two adapter-specific metadata payloads during hydration. @@ -106,7 +106,7 @@ Merge two adapter-specific metadata payloads during hydration. optional rowUpdateMode: "full" | "partial"; ``` -Defined in: [packages/db/src/types.ts:497](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L497) +Defined in: [packages/db/src/types.ts:519](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L519) The row update mode used to sync to the collection. @@ -130,7 +130,7 @@ sync: (params) => | SyncConfigRes; ``` -Defined in: [packages/db/src/types.ts:435](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L435) +Defined in: [packages/db/src/types.ts:449](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L449) #### Parameters @@ -159,6 +159,16 @@ optimistic state. A signal that is already aborted abandons the transaction before acceptance, and the receipt rejects with an error named `AbortError`. Aborting after acceptance has no effect. +###### invalidateLoadedSubsets + +() => `void` + +Report that rows this adapter serves for loaded subsets may have shifted +between served pages, after a refetch that the adapter started on its +own has applied. Each ordered live query then re-establishes its window +with a bounded repair from the start of its order. Calls in one turn are +coalesced. Do not call it for results that answer a `loadSubset` call. + ###### markError (`error?`) => `void` diff --git a/docs/reference/interfaces/SyncMetadataApi.md b/docs/reference/interfaces/SyncMetadataApi.md index 2e517d7b27..226eb71116 100644 --- a/docs/reference/interfaces/SyncMetadataApi.md +++ b/docs/reference/interfaces/SyncMetadataApi.md @@ -3,7 +3,7 @@ id: SyncMetadataApi title: SyncMetadataApi --- -Defined in: [packages/db/src/types.ts:500](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L500) +Defined in: [packages/db/src/types.ts:522](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L522) ## Type Parameters @@ -19,7 +19,7 @@ Defined in: [packages/db/src/types.ts:500](https://github.com/TanStack/db/blob/m collection: object; ``` -Defined in: [packages/db/src/types.ts:508](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L508) +Defined in: [packages/db/src/types.ts:530](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L530) #### delete() @@ -99,7 +99,7 @@ persistence: | null; ``` -Defined in: [packages/db/src/types.ts:526](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L526) +Defined in: [packages/db/src/types.ts:548](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L548) **`Internal`** @@ -119,7 +119,7 @@ invalid. row: object; ``` -Defined in: [packages/db/src/types.ts:503](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L503) +Defined in: [packages/db/src/types.ts:525](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L525) #### delete() diff --git a/docs/reference/query-db-collection/functions/queryCollectionOptions.md b/docs/reference/query-db-collection/functions/queryCollectionOptions.md index adbb3b3f2d..8cc2249e7b 100644 --- a/docs/reference/query-db-collection/functions/queryCollectionOptions.md +++ b/docs/reference/query-db-collection/functions/queryCollectionOptions.md @@ -9,7 +9,7 @@ title: queryCollectionOptions function queryCollectionOptions(config): CollectionConfig, TKey, T, QueryCollectionUtils, TKey, InferSchemaInput, TError>> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:575](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L575) +Defined in: [packages/query-db-collection/src/query.ts:576](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L576) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. @@ -149,7 +149,7 @@ const todosCollection = createCollection( function queryCollectionOptions(config): CollectionConfig> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:614](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L614) +Defined in: [packages/query-db-collection/src/query.ts:615](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L615) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. @@ -289,7 +289,7 @@ const todosCollection = createCollection( function queryCollectionOptions(config): CollectionConfig, TKey, T, QueryCollectionUtils, TKey, InferSchemaInput, TError>> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:647](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L647) +Defined in: [packages/query-db-collection/src/query.ts:648](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L648) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. @@ -421,7 +421,7 @@ const todosCollection = createCollection( function queryCollectionOptions(config): CollectionConfig> & object; ``` -Defined in: [packages/query-db-collection/src/query.ts:681](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L681) +Defined in: [packages/query-db-collection/src/query.ts:682](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L682) Creates query collection options for use with a standard Collection. This integrates TanStack Query with TanStack DB for automatic synchronization. diff --git a/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md b/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md index 2ff36c5f33..16d09031e3 100644 --- a/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md +++ b/docs/reference/query-db-collection/interfaces/QueryCollectionConfig.md @@ -3,7 +3,7 @@ id: QueryCollectionConfig title: QueryCollectionConfig --- -Defined in: [packages/query-db-collection/src/query.ts:116](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L116) +Defined in: [packages/query-db-collection/src/query.ts:117](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L117) Configuration options for creating a Query Collection @@ -61,7 +61,7 @@ The schema type for validation optional enabled: Enabled; ``` -Defined in: [packages/query-db-collection/src/query.ts:155](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L155) +Defined in: [packages/query-db-collection/src/query.ts:156](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L156) Whether the query should automatically run (default: true) @@ -73,7 +73,7 @@ Whether the query should automatically run (default: true) optional gcTime: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:190](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L190) +Defined in: [packages/query-db-collection/src/query.ts:191](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L191) Time in milliseconds after which the collection will be garbage collected when it has no active subscribers. Defaults to 5 minutes (300000ms). @@ -96,7 +96,7 @@ BaseCollectionConfig.gcTime optional initialData: TQueryData | InitialDataFunction; ``` -Defined in: [packages/query-db-collection/src/query.ts:230](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L230) +Defined in: [packages/query-db-collection/src/query.ts:231](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L231) Data used to initialize the TanStack Query cache for an eager collection. The value has the original Query response shape and is projected through @@ -110,7 +110,7 @@ the collection's select option before rows are materialized. optional initialDataUpdatedAt: number | () => number | undefined; ``` -Defined in: [packages/query-db-collection/src/query.ts:238](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L238) +Defined in: [packages/query-db-collection/src/query.ts:239](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L239) The timestamp TanStack Query uses to determine initialData freshness. @@ -122,7 +122,7 @@ The timestamp TanStack Query uses to determine initialData freshness. optional meta: Record; ``` -Defined in: [packages/query-db-collection/src/query.ts:267](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L267) +Defined in: [packages/query-db-collection/src/query.ts:268](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L268) Metadata to pass to the query. Available in queryFn via context.meta @@ -154,7 +154,7 @@ meta: { optional networkMode: NetworkMode; ``` -Defined in: [packages/query-db-collection/src/query.ts:218](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L218) +Defined in: [packages/query-db-collection/src/query.ts:219](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L219) *** @@ -164,7 +164,7 @@ Defined in: [packages/query-db-collection/src/query.ts:218](https://github.com/T optional persistedGcTime: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:245](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L245) +Defined in: [packages/query-db-collection/src/query.ts:246](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L246) *** @@ -174,7 +174,7 @@ Defined in: [packages/query-db-collection/src/query.ts:245](https://github.com/T queryClient: QueryClient; ``` -Defined in: [packages/query-db-collection/src/query.ts:151](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L151) +Defined in: [packages/query-db-collection/src/query.ts:152](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L152) The TanStack Query client instance @@ -186,7 +186,7 @@ The TanStack Query client instance queryFn: TQueryFn extends (context) => any[] | Promise ? (context) => T[] | Promise : TQueryFn; ``` -Defined in: [packages/query-db-collection/src/query.ts:140](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L140) +Defined in: [packages/query-db-collection/src/query.ts:141](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L141) Function that fetches data from the server. Must return the complete collection state @@ -198,7 +198,7 @@ Function that fetches data from the server. Must return the complete collection queryKey: TQueryKey | TQueryKeyBuilder; ``` -Defined in: [packages/query-db-collection/src/query.ts:138](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L138) +Defined in: [packages/query-db-collection/src/query.ts:139](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L139) The query key used by TanStack Query to identify this query @@ -210,7 +210,7 @@ The query key used by TanStack Query to identify this query optional refetchInterval: number | false | (query) => number | false | undefined; ``` -Defined in: [packages/query-db-collection/src/query.ts:162](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L162) +Defined in: [packages/query-db-collection/src/query.ts:163](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L163) *** @@ -220,7 +220,7 @@ Defined in: [packages/query-db-collection/src/query.ts:162](https://github.com/T optional refetchOnMount: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-db-collection/src/query.ts:211](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L211) +Defined in: [packages/query-db-collection/src/query.ts:212](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L212) *** @@ -230,7 +230,7 @@ Defined in: [packages/query-db-collection/src/query.ts:211](https://github.com/T optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-db-collection/src/query.ts:204](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L204) +Defined in: [packages/query-db-collection/src/query.ts:205](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L205) *** @@ -240,7 +240,7 @@ Defined in: [packages/query-db-collection/src/query.ts:204](https://github.com/T optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"; ``` -Defined in: [packages/query-db-collection/src/query.ts:197](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L197) +Defined in: [packages/query-db-collection/src/query.ts:198](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L198) *** @@ -250,7 +250,7 @@ Defined in: [packages/query-db-collection/src/query.ts:197](https://github.com/T optional retry: RetryValue; ``` -Defined in: [packages/query-db-collection/src/query.ts:169](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L169) +Defined in: [packages/query-db-collection/src/query.ts:170](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L170) *** @@ -260,7 +260,7 @@ Defined in: [packages/query-db-collection/src/query.ts:169](https://github.com/T optional retryDelay: RetryDelayValue; ``` -Defined in: [packages/query-db-collection/src/query.ts:176](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L176) +Defined in: [packages/query-db-collection/src/query.ts:177](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L177) *** @@ -270,7 +270,7 @@ Defined in: [packages/query-db-collection/src/query.ts:176](https://github.com/T optional select: (data) => T[]; ``` -Defined in: [packages/query-db-collection/src/query.ts:149](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L149) +Defined in: [packages/query-db-collection/src/query.ts:150](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L150) Extracts the row array TanStack DB materializes from the Query response. The Query cache keeps the original response shape. @@ -293,4 +293,4 @@ The Query cache keeps the original response shape. optional staleTime: StaleTimeFunction; ``` -Defined in: [packages/query-db-collection/src/query.ts:183](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L183) +Defined in: [packages/query-db-collection/src/query.ts:184](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L184) diff --git a/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md b/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md index 07616fb317..5d1f24234d 100644 --- a/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md +++ b/docs/reference/query-db-collection/interfaces/QueryCollectionUtils.md @@ -3,7 +3,7 @@ id: QueryCollectionUtils title: QueryCollectionUtils --- -Defined in: [packages/query-db-collection/src/query.ts:300](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L300) +Defined in: [packages/query-db-collection/src/query.ts:301](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L301) Utility methods available on Query Collections for direct writes and manual operations. Direct writes bypass optimistic mutations and write to the synced data store. @@ -44,7 +44,7 @@ The type of errors that can occur during queries clearError: () => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:356](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L356) +Defined in: [packages/query-db-collection/src/query.ts:357](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L357) Refetch, retaining errors until a successful result applies. While a user mutation is persisting or its handler is active, this retains the Query @@ -69,7 +69,7 @@ Error if the refetch fails dataUpdatedAt: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:340](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L340) +Defined in: [packages/query-db-collection/src/query.ts:341](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L341) Get timestamp of last successful data update (in milliseconds) @@ -81,7 +81,7 @@ Get timestamp of last successful data update (in milliseconds) errorCount: number; ``` -Defined in: [packages/query-db-collection/src/query.ts:332](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L332) +Defined in: [packages/query-db-collection/src/query.ts:333](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L333) Get the number of consecutive sync failures. Incremented only when query fails completely (not per retry attempt); reset after a successful result applies. @@ -94,7 +94,7 @@ Incremented only when query fails completely (not per retry attempt); reset afte fetchStatus: "idle" | "fetching" | "paused"; ``` -Defined in: [packages/query-db-collection/src/query.ts:346](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L346) +Defined in: [packages/query-db-collection/src/query.ts:347](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L347) Get the aggregate observer fetch status. Returns `fetching` if any observer is fetching, otherwise `paused` if any observer is paused, and @@ -108,7 +108,7 @@ observer is fetching, otherwise `paused` if any observer is paused, and isError: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:327](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L327) +Defined in: [packages/query-db-collection/src/query.ts:328](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L328) Check if the collection is in an error state @@ -120,7 +120,7 @@ Check if the collection is in an error state isFetching: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:334](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L334) +Defined in: [packages/query-db-collection/src/query.ts:335](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L335) Check if query is currently fetching (initial or background) @@ -132,7 +132,7 @@ Check if query is currently fetching (initial or background) isLoading: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:338](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L338) +Defined in: [packages/query-db-collection/src/query.ts:339](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L339) Check if query is loading for the first time (no data yet) @@ -144,7 +144,7 @@ Check if query is loading for the first time (no data yet) isRefetching: boolean; ``` -Defined in: [packages/query-db-collection/src/query.ts:336](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L336) +Defined in: [packages/query-db-collection/src/query.ts:337](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L337) Check if query is refetching in background (not initial fetch) @@ -156,7 +156,7 @@ Check if query is refetching in background (not initial fetch) lastError: TError | undefined; ``` -Defined in: [packages/query-db-collection/src/query.ts:325](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L325) +Defined in: [packages/query-db-collection/src/query.ts:326](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L326) Get the last error encountered by the query (if any); reset after a successful result applies @@ -168,7 +168,7 @@ Get the last error encountered by the query (if any); reset after a successful r refetch: RefetchFn; ``` -Defined in: [packages/query-db-collection/src/query.ts:309](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L309) +Defined in: [packages/query-db-collection/src/query.ts:310](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L310) Manually refetch and await the applicable fetch or application boundary. @@ -180,7 +180,7 @@ Manually refetch and await the applicable fetch or application boundary. writeBatch: (callback) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:321](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L321) +Defined in: [packages/query-db-collection/src/query.ts:322](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L322) Execute direct writes as one atomic batch. Resolves when the sync commit applies. @@ -202,7 +202,7 @@ Execute direct writes as one atomic batch. Resolves when the sync commit applies writeDelete: (keys) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:317](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L317) +Defined in: [packages/query-db-collection/src/query.ts:318](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L318) Delete items without an optimistic update. Resolves when the sync commit applies. @@ -224,7 +224,7 @@ Delete items without an optimistic update. Resolves when the sync commit applies writeInsert: (data) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:311](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L311) +Defined in: [packages/query-db-collection/src/query.ts:312](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L312) Insert items without an optimistic update. Resolves when the sync commit applies. @@ -246,7 +246,7 @@ Insert items without an optimistic update. Resolves when the sync commit applies writeUpdate: (updates) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:313](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L313) +Defined in: [packages/query-db-collection/src/query.ts:314](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L314) Update items without an optimistic update. Resolves when the sync commit applies. @@ -268,7 +268,7 @@ Update items without an optimistic update. Resolves when the sync commit applies writeUpsert: (data) => Promise; ``` -Defined in: [packages/query-db-collection/src/query.ts:319](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L319) +Defined in: [packages/query-db-collection/src/query.ts:320](https://github.com/TanStack/db/blob/main/packages/query-db-collection/src/query.ts#L320) Insert or update items without an optimistic update. Resolves when the sync commit applies. diff --git a/docs/reference/type-aliases/ChangeListener.md b/docs/reference/type-aliases/ChangeListener.md index 07d6ee33c1..e3dac4662e 100644 --- a/docs/reference/type-aliases/ChangeListener.md +++ b/docs/reference/type-aliases/ChangeListener.md @@ -7,7 +7,7 @@ title: ChangeListener type ChangeListener = (changes) => void; ``` -Defined in: [packages/db/src/types.ts:1209](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1209) +Defined in: [packages/db/src/types.ts:1231](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1231) Function type for listening to collection changes Changes to the same key retain their causal order within a callback. diff --git a/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md b/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md index ca6d2a6caf..0780031d3a 100644 --- a/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md +++ b/docs/reference/type-aliases/ChangeMessageOrDeleteKeyMessage.md @@ -9,7 +9,7 @@ type ChangeMessageOrDeleteKeyMessage = | DeleteKeyMessage; ``` -Defined in: [packages/db/src/types.ts:594](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L594) +Defined in: [packages/db/src/types.ts:616](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L616) ## Type Parameters diff --git a/docs/reference/type-aliases/ChangesPayload.md b/docs/reference/type-aliases/ChangesPayload.md index 39e62f18e0..1ce72c6260 100644 --- a/docs/reference/type-aliases/ChangesPayload.md +++ b/docs/reference/type-aliases/ChangesPayload.md @@ -7,7 +7,7 @@ title: ChangesPayload type ChangesPayload = ChangeMessage, TKey>[]; ``` -Defined in: [packages/db/src/types.ts:1051](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1051) +Defined in: [packages/db/src/types.ts:1073](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1073) ## Type Parameters diff --git a/docs/reference/type-aliases/CleanupFn.md b/docs/reference/type-aliases/CleanupFn.md index 133acfd615..47d8eeb4d5 100644 --- a/docs/reference/type-aliases/CleanupFn.md +++ b/docs/reference/type-aliases/CleanupFn.md @@ -7,7 +7,7 @@ title: CleanupFn type CleanupFn = () => void | () => Promise; ``` -Defined in: [packages/db/src/types.ts:415](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L415) +Defined in: [packages/db/src/types.ts:429](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L429) Ends one sync run and releases its adapter-owned resources. diff --git a/docs/reference/type-aliases/CollectionConfigSingleRowOption.md b/docs/reference/type-aliases/CollectionConfigSingleRowOption.md index 6ae70160c4..a1c12e004e 100644 --- a/docs/reference/type-aliases/CollectionConfigSingleRowOption.md +++ b/docs/reference/type-aliases/CollectionConfigSingleRowOption.md @@ -7,7 +7,7 @@ title: CollectionConfigSingleRowOption type CollectionConfigSingleRowOption = CollectionConfig & MaybeSingleResult; ``` -Defined in: [packages/db/src/types.ts:1044](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1044) +Defined in: [packages/db/src/types.ts:1066](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1066) ## Type Parameters diff --git a/docs/reference/type-aliases/CollectionStatus.md b/docs/reference/type-aliases/CollectionStatus.md index e97597f3df..f71cb52d12 100644 --- a/docs/reference/type-aliases/CollectionStatus.md +++ b/docs/reference/type-aliases/CollectionStatus.md @@ -7,7 +7,7 @@ title: CollectionStatus type CollectionStatus = "idle" | "loading" | "ready" | "error" | "cleaned-up"; ``` -Defined in: [packages/db/src/types.ts:726](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L726) +Defined in: [packages/db/src/types.ts:748](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L748) Collection status values for lifecycle management diff --git a/docs/reference/type-aliases/DeleteKeyMessage.md b/docs/reference/type-aliases/DeleteKeyMessage.md index bcf5c2041b..8c2f9aeacd 100644 --- a/docs/reference/type-aliases/DeleteKeyMessage.md +++ b/docs/reference/type-aliases/DeleteKeyMessage.md @@ -7,7 +7,7 @@ title: DeleteKeyMessage type DeleteKeyMessage = Omit, "value" | "previousValue" | "type"> & object; ``` -Defined in: [packages/db/src/types.ts:589](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L589) +Defined in: [packages/db/src/types.ts:611](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L611) ## Type Declaration diff --git a/docs/reference/type-aliases/DeleteMutationFn.md b/docs/reference/type-aliases/DeleteMutationFn.md index 46bbed4f46..97fdb55e33 100644 --- a/docs/reference/type-aliases/DeleteMutationFn.md +++ b/docs/reference/type-aliases/DeleteMutationFn.md @@ -7,7 +7,7 @@ title: DeleteMutationFn type DeleteMutationFn = (params) => Promise; ``` -Defined in: [packages/db/src/types.ts:703](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L703) +Defined in: [packages/db/src/types.ts:725](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L725) ## Type Parameters diff --git a/docs/reference/type-aliases/DeleteMutationFnParams.md b/docs/reference/type-aliases/DeleteMutationFnParams.md index dd23aa733d..8ccf71df62 100644 --- a/docs/reference/type-aliases/DeleteMutationFnParams.md +++ b/docs/reference/type-aliases/DeleteMutationFnParams.md @@ -7,7 +7,7 @@ title: DeleteMutationFnParams type DeleteMutationFnParams = object; ``` -Defined in: [packages/db/src/types.ts:667](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L667) +Defined in: [packages/db/src/types.ts:689](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L689) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/db/src/types.ts:667](https://github.com/TanStack/db/blob/m collection: Collection; ``` -Defined in: [packages/db/src/types.ts:677](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L677) +Defined in: [packages/db/src/types.ts:699](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L699) *** @@ -41,4 +41,4 @@ Defined in: [packages/db/src/types.ts:677](https://github.com/TanStack/db/blob/m transaction: TransactionWithMutations>; ``` -Defined in: [packages/db/src/types.ts:672](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L672) +Defined in: [packages/db/src/types.ts:694](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L694) diff --git a/docs/reference/type-aliases/InputRow.md b/docs/reference/type-aliases/InputRow.md index 718a34d094..7bfe23b61e 100644 --- a/docs/reference/type-aliases/InputRow.md +++ b/docs/reference/type-aliases/InputRow.md @@ -7,6 +7,6 @@ title: InputRow type InputRow = [unknown, Record]; ``` -Defined in: [packages/db/src/types.ts:1059](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1059) +Defined in: [packages/db/src/types.ts:1081](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1081) An input row from a collection diff --git a/docs/reference/type-aliases/InsertMutationFn.md b/docs/reference/type-aliases/InsertMutationFn.md index e3aed64b20..0e8cc31b84 100644 --- a/docs/reference/type-aliases/InsertMutationFn.md +++ b/docs/reference/type-aliases/InsertMutationFn.md @@ -7,7 +7,7 @@ title: InsertMutationFn type InsertMutationFn = (params) => Promise; ``` -Defined in: [packages/db/src/types.ts:683](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L683) +Defined in: [packages/db/src/types.ts:705](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L705) ## Type Parameters diff --git a/docs/reference/type-aliases/InsertMutationFnParams.md b/docs/reference/type-aliases/InsertMutationFnParams.md index 1de3c1cfde..68987e1a8c 100644 --- a/docs/reference/type-aliases/InsertMutationFnParams.md +++ b/docs/reference/type-aliases/InsertMutationFnParams.md @@ -7,7 +7,7 @@ title: InsertMutationFnParams type InsertMutationFnParams = object; ``` -Defined in: [packages/db/src/types.ts:655](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L655) +Defined in: [packages/db/src/types.ts:677](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L677) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/db/src/types.ts:655](https://github.com/TanStack/db/blob/m collection: Collection; ``` -Defined in: [packages/db/src/types.ts:665](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L665) +Defined in: [packages/db/src/types.ts:687](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L687) *** @@ -41,4 +41,4 @@ Defined in: [packages/db/src/types.ts:665](https://github.com/TanStack/db/blob/m transaction: TransactionWithMutations>; ``` -Defined in: [packages/db/src/types.ts:660](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L660) +Defined in: [packages/db/src/types.ts:682](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L682) diff --git a/docs/reference/type-aliases/KeyedNamespacedRow.md b/docs/reference/type-aliases/KeyedNamespacedRow.md index 2a3f49d2ec..d23d8f50b3 100644 --- a/docs/reference/type-aliases/KeyedNamespacedRow.md +++ b/docs/reference/type-aliases/KeyedNamespacedRow.md @@ -7,7 +7,7 @@ title: KeyedNamespacedRow type KeyedNamespacedRow = [unknown, NamespacedRow]; ``` -Defined in: [packages/db/src/types.ts:1082](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1082) +Defined in: [packages/db/src/types.ts:1104](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1104) A keyed namespaced row is a row with a key and a namespaced row This is the main representation of a row in a query pipeline diff --git a/docs/reference/type-aliases/KeyedStream.md b/docs/reference/type-aliases/KeyedStream.md index e4bb4a672a..df84f23ad8 100644 --- a/docs/reference/type-aliases/KeyedStream.md +++ b/docs/reference/type-aliases/KeyedStream.md @@ -7,7 +7,7 @@ title: KeyedStream type KeyedStream = IStreamBuilder; ``` -Defined in: [packages/db/src/types.ts:1065](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1065) +Defined in: [packages/db/src/types.ts:1087](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1087) A keyed stream is a stream of rows This is used as the inputs from a collection to a query diff --git a/docs/reference/type-aliases/LoadSubsetFn.md b/docs/reference/type-aliases/LoadSubsetFn.md index ee5fd5f9ae..3e0e740b17 100644 --- a/docs/reference/type-aliases/LoadSubsetFn.md +++ b/docs/reference/type-aliases/LoadSubsetFn.md @@ -7,7 +7,7 @@ title: LoadSubsetFn type LoadSubsetFn = (options) => true | Promise; ``` -Defined in: [packages/db/src/types.ts:385](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L385) +Defined in: [packages/db/src/types.ts:399](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L399) Loads one subset and transfers its ongoing resource ownership only after returning `true` or a promise. An implementation that throws synchronously @@ -16,6 +16,13 @@ implementation must await or return every receipt from the sync `commit()` calls that establish the loaded subset. A result describes only the exact `options` passed to this call. +When a sync adapter refetches loaded subsets without a new `loadSubset` +call, it either keeps each served ordered prefix whole (see +`LoadSubsetOptions`), or calls `invalidateLoadedSubsets()` once the +refetched rows apply. Refetching each ordered page alone keeps neither +promise: a row that now sorts between two served pages is in neither +result, and the loader receives no change that would request it. + ## Parameters ### options diff --git a/docs/reference/type-aliases/LoadSubsetOptions.md b/docs/reference/type-aliases/LoadSubsetOptions.md index 0a683a4fc2..61f89215a6 100644 --- a/docs/reference/type-aliases/LoadSubsetOptions.md +++ b/docs/reference/type-aliases/LoadSubsetOptions.md @@ -7,7 +7,7 @@ title: LoadSubsetOptions type LoadSubsetOptions = object; ``` -Defined in: [packages/db/src/types.ts:331](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L331) +Defined in: [packages/db/src/types.ts:338](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L338) Immutable request data. From submission onward, callers and adapters must not mutate these options, their expression trees, comparison options, or @@ -17,6 +17,13 @@ Use stable data properties, not stateful getters, for request data. Signal and subscription references stay fixed, but their lifecycle remains live: aborting the signal or releasing the subscription is supported. +An ordered request with `orderBy` serves a prefix: every matching row from +the start of the order through its boundary, the leading order value of the +last row the request returned, ties included. A request that returned no +rows served no prefix. The ordered loader treats every row in a served +prefix as loaded. See `LoadSubsetFn` for what a sync adapter owes after it +refetches. + ## Properties ### cursor? @@ -25,7 +32,7 @@ live: aborting the signal or releasing the subscription is supported. optional cursor: CursorExpressions; ``` -Defined in: [packages/db/src/types.ts:349](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L349) +Defined in: [packages/db/src/types.ts:356](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L356) Cursor expressions for cursor-based pagination. These are separate from `where` - the sync layer should combine them if using cursor-based pagination. @@ -39,7 +46,7 @@ Neither expression includes the main `where` clause. optional limit: number; ``` -Defined in: [packages/db/src/types.ts:343](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L343) +Defined in: [packages/db/src/types.ts:350](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L350) The limit of the data to load @@ -51,7 +58,7 @@ The limit of the data to load optional offset: number; ``` -Defined in: [packages/db/src/types.ts:354](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L354) +Defined in: [packages/db/src/types.ts:361](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L361) Row offset for offset-based pagination. The sync layer can use this instead of `cursor` if it prefers offset-based pagination. @@ -64,7 +71,7 @@ The sync layer can use this instead of `cursor` if it prefers offset-based pagin optional orderBy: OrderBy; ``` -Defined in: [packages/db/src/types.ts:341](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L341) +Defined in: [packages/db/src/types.ts:348](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L348) The order by clause to sort the data @@ -76,7 +83,7 @@ The order by clause to sort the data optional refetch: boolean; ``` -Defined in: [packages/db/src/types.ts:337](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L337) +Defined in: [packages/db/src/types.ts:344](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L344) Revalidate this exact semantic demand even when an adapter has already completed or cached it. This controls the acquisition attempt; it does @@ -90,7 +97,7 @@ not change demand identity or the matching unload operation. optional signal: AbortSignal; ``` -Defined in: [packages/db/src/types.ts:362](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L362) +Defined in: [packages/db/src/types.ts:369](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L369) Aborted when this exact subset request is no longer current. Cancellation is cooperative: async adapters should stop before installing more @@ -106,7 +113,7 @@ core can keep overlapping replay private until then. optional subscription: Subscription; ``` -Defined in: [packages/db/src/types.ts:371](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L371) +Defined in: [packages/db/src/types.ts:378](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L378) The subscription that triggered the load. Advanced sync implementations can use this for: @@ -126,6 +133,6 @@ Available when called from CollectionSubscription, may be undefined for direct c optional where: BasicExpression; ``` -Defined in: [packages/db/src/types.ts:339](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L339) +Defined in: [packages/db/src/types.ts:346](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L346) The where expression to filter the data (does NOT include cursor expressions) diff --git a/docs/reference/type-aliases/LoadSubsetRequestResult.md b/docs/reference/type-aliases/LoadSubsetRequestResult.md index 43092e3c8e..bbf241be19 100644 --- a/docs/reference/type-aliases/LoadSubsetRequestResult.md +++ b/docs/reference/type-aliases/LoadSubsetRequestResult.md @@ -7,7 +7,7 @@ title: LoadSubsetRequestResult type LoadSubsetRequestResult = true | Promise; ``` -Defined in: [packages/db/src/types.ts:375](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L375) +Defined in: [packages/db/src/types.ts:382](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L382) **`Internal`** diff --git a/docs/reference/type-aliases/MakeOptional.md b/docs/reference/type-aliases/MakeOptional.md index ee3d26a620..52ecf1eefb 100644 --- a/docs/reference/type-aliases/MakeOptional.md +++ b/docs/reference/type-aliases/MakeOptional.md @@ -7,7 +7,7 @@ title: MakeOptional type MakeOptional = Omit & Partial>; ``` -Defined in: [packages/db/src/types.ts:1288](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1288) +Defined in: [packages/db/src/types.ts:1310](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1310) ## Type Parameters diff --git a/docs/reference/type-aliases/MaybeSingleResult.md b/docs/reference/type-aliases/MaybeSingleResult.md index d1170110ec..9508dc5fbd 100644 --- a/docs/reference/type-aliases/MaybeSingleResult.md +++ b/docs/reference/type-aliases/MaybeSingleResult.md @@ -7,7 +7,7 @@ title: MaybeSingleResult type MaybeSingleResult = object; ``` -Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1036) +Defined in: [packages/db/src/types.ts:1058](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1058) ## Properties @@ -17,6 +17,6 @@ Defined in: [packages/db/src/types.ts:1036](https://github.com/TanStack/db/blob/ optional singleResult: true; ``` -Defined in: [packages/db/src/types.ts:1040](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1040) +Defined in: [packages/db/src/types.ts:1062](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1062) If enabled the collection will return a single object instead of an array diff --git a/docs/reference/type-aliases/NamespacedAndKeyedStream.md b/docs/reference/type-aliases/NamespacedAndKeyedStream.md index 5095a65ed8..cd10e175d5 100644 --- a/docs/reference/type-aliases/NamespacedAndKeyedStream.md +++ b/docs/reference/type-aliases/NamespacedAndKeyedStream.md @@ -7,7 +7,7 @@ title: NamespacedAndKeyedStream type NamespacedAndKeyedStream = IStreamBuilder; ``` -Defined in: [packages/db/src/types.ts:1089](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1089) +Defined in: [packages/db/src/types.ts:1111](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1111) A namespaced and keyed stream is a stream of rows This is used throughout a query pipeline and as the output from a query without diff --git a/docs/reference/type-aliases/NamespacedRow.md b/docs/reference/type-aliases/NamespacedRow.md index f04f691dd5..131ac7be6d 100644 --- a/docs/reference/type-aliases/NamespacedRow.md +++ b/docs/reference/type-aliases/NamespacedRow.md @@ -7,6 +7,6 @@ title: NamespacedRow type NamespacedRow = Record>; ``` -Defined in: [packages/db/src/types.ts:1076](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1076) +Defined in: [packages/db/src/types.ts:1098](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1098) A namespaced row is a row withing a pipeline that had each table wrapped in its alias diff --git a/docs/reference/type-aliases/NonSingleResult.md b/docs/reference/type-aliases/NonSingleResult.md index 96e98a2a34..293c5a87f2 100644 --- a/docs/reference/type-aliases/NonSingleResult.md +++ b/docs/reference/type-aliases/NonSingleResult.md @@ -7,7 +7,7 @@ title: NonSingleResult type NonSingleResult = object; ``` -Defined in: [packages/db/src/types.ts:1032](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1032) +Defined in: [packages/db/src/types.ts:1054](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1054) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:1032](https://github.com/TanStack/db/blob/ optional singleResult: never; ``` -Defined in: [packages/db/src/types.ts:1033](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1033) +Defined in: [packages/db/src/types.ts:1055](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1055) diff --git a/docs/reference/type-aliases/OptimisticChangeMessage.md b/docs/reference/type-aliases/OptimisticChangeMessage.md index 671e2786fb..3dfdea5c72 100644 --- a/docs/reference/type-aliases/OptimisticChangeMessage.md +++ b/docs/reference/type-aliases/OptimisticChangeMessage.md @@ -9,7 +9,7 @@ type OptimisticChangeMessage = | DeleteKeyMessage & object; ``` -Defined in: [packages/db/src/types.ts:599](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L599) +Defined in: [packages/db/src/types.ts:621](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L621) ## Type Parameters diff --git a/docs/reference/type-aliases/ResultStream.md b/docs/reference/type-aliases/ResultStream.md index 3dec6bd5dc..3ba095598b 100644 --- a/docs/reference/type-aliases/ResultStream.md +++ b/docs/reference/type-aliases/ResultStream.md @@ -7,7 +7,7 @@ title: ResultStream type ResultStream = IStreamBuilder<[unknown, [any, string | undefined]]>; ``` -Defined in: [packages/db/src/types.ts:1071](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1071) +Defined in: [packages/db/src/types.ts:1093](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1093) Result stream type representing the output of compiled queries Always returns [key, [result, orderByIndex]] where orderByIndex is undefined for unordered queries diff --git a/docs/reference/type-aliases/SingleResult.md b/docs/reference/type-aliases/SingleResult.md index 0c9ea92e08..a1c51c60bf 100644 --- a/docs/reference/type-aliases/SingleResult.md +++ b/docs/reference/type-aliases/SingleResult.md @@ -7,7 +7,7 @@ title: SingleResult type SingleResult = object; ``` -Defined in: [packages/db/src/types.ts:1028](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1028) +Defined in: [packages/db/src/types.ts:1050](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1050) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:1028](https://github.com/TanStack/db/blob/ singleResult: true; ``` -Defined in: [packages/db/src/types.ts:1029](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1029) +Defined in: [packages/db/src/types.ts:1051](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1051) diff --git a/docs/reference/type-aliases/StandardSchema.md b/docs/reference/type-aliases/StandardSchema.md index 05dec1dd4d..d909673057 100644 --- a/docs/reference/type-aliases/StandardSchema.md +++ b/docs/reference/type-aliases/StandardSchema.md @@ -7,7 +7,7 @@ title: StandardSchema type StandardSchema = StandardSchemaV1 & object; ``` -Defined in: [packages/db/src/types.ts:616](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L616) +Defined in: [packages/db/src/types.ts:638](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L638) The Standard Schema interface. This follows the standard-schema specification: https://github.com/standard-schema/standard-schema diff --git a/docs/reference/type-aliases/StandardSchemaAlias.md b/docs/reference/type-aliases/StandardSchemaAlias.md index bf994eaf7e..e2d0ef4c6c 100644 --- a/docs/reference/type-aliases/StandardSchemaAlias.md +++ b/docs/reference/type-aliases/StandardSchemaAlias.md @@ -7,7 +7,7 @@ title: StandardSchemaAlias type StandardSchemaAlias = StandardSchema; ``` -Defined in: [packages/db/src/types.ts:628](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L628) +Defined in: [packages/db/src/types.ts:650](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L650) Type alias for StandardSchema diff --git a/docs/reference/type-aliases/SyncAppliedReceipt.md b/docs/reference/type-aliases/SyncAppliedReceipt.md index e4815415b8..88b87eccee 100644 --- a/docs/reference/type-aliases/SyncAppliedReceipt.md +++ b/docs/reference/type-aliases/SyncAppliedReceipt.md @@ -7,7 +7,7 @@ title: SyncAppliedReceipt type SyncAppliedReceipt = true | Promise; ``` -Defined in: [packages/db/src/types.ts:393](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L393) +Defined in: [packages/db/src/types.ts:407](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L407) Confirms that a committed sync transaction is visible, or resolves when it becomes visible. An accepted transaction always applies in commit order. A diff --git a/docs/reference/type-aliases/SyncConfigRes.md b/docs/reference/type-aliases/SyncConfigRes.md index ecfe5f8992..1eac0e4bac 100644 --- a/docs/reference/type-aliases/SyncConfigRes.md +++ b/docs/reference/type-aliases/SyncConfigRes.md @@ -7,7 +7,7 @@ title: SyncConfigRes type SyncConfigRes = object; ``` -Defined in: [packages/db/src/types.ts:417](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L417) +Defined in: [packages/db/src/types.ts:431](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L431) ## Properties @@ -17,7 +17,7 @@ Defined in: [packages/db/src/types.ts:417](https://github.com/TanStack/db/blob/m optional cleanup: CleanupFn; ``` -Defined in: [packages/db/src/types.ts:418](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L418) +Defined in: [packages/db/src/types.ts:432](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L432) *** @@ -27,7 +27,7 @@ Defined in: [packages/db/src/types.ts:418](https://github.com/TanStack/db/blob/m optional loadSubset: LoadSubsetFn; ``` -Defined in: [packages/db/src/types.ts:419](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L419) +Defined in: [packages/db/src/types.ts:433](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L433) *** @@ -37,7 +37,7 @@ Defined in: [packages/db/src/types.ts:419](https://github.com/TanStack/db/blob/m optional restartAfterScopedRecovery: (cacheRotated) => void | Promise; ``` -Defined in: [packages/db/src/types.ts:427](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L427) +Defined in: [packages/db/src/types.ts:441](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L441) Optional provider-controlled restart for a lost managed cache claim. Retire old provider callbacks synchronously and start the replacement only @@ -62,4 +62,4 @@ absent, the persistence wrapper cleans up and reenters `sync` itself. optional unloadSubset: UnloadSubsetFn; ``` -Defined in: [packages/db/src/types.ts:420](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L420) +Defined in: [packages/db/src/types.ts:434](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L434) diff --git a/docs/reference/type-aliases/SyncMode.md b/docs/reference/type-aliases/SyncMode.md index eb6581d046..de81065dbd 100644 --- a/docs/reference/type-aliases/SyncMode.md +++ b/docs/reference/type-aliases/SyncMode.md @@ -7,4 +7,4 @@ title: SyncMode type SyncMode = "eager" | "on-demand"; ``` -Defined in: [packages/db/src/types.ts:738](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L738) +Defined in: [packages/db/src/types.ts:760](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L760) diff --git a/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md b/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md index 4cfc3838e6..f8a02b431e 100644 --- a/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md +++ b/docs/reference/type-aliases/SyncPersistenceCapabilityV1.md @@ -7,7 +7,7 @@ title: SyncPersistenceCapabilityV1 type SyncPersistenceCapabilityV1 = object; ``` -Defined in: [packages/db/src/types.ts:548](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L548) +Defined in: [packages/db/src/types.ts:570](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L570) **`Internal`** @@ -27,7 +27,7 @@ Unstable cross-package protocol for persistence-aware adapters. readonly hydrateBaseline: () => Promise; ``` -Defined in: [packages/db/src/types.ts:557](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L557) +Defined in: [packages/db/src/types.ts:579](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L579) #### Returns @@ -41,7 +41,7 @@ Defined in: [packages/db/src/types.ts:557](https://github.com/TanStack/db/blob/m readonly optional managedCacheGeneration: boolean; ``` -Defined in: [packages/db/src/types.ts:554](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L554) +Defined in: [packages/db/src/types.ts:576](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L576) This run owns a claimed on-demand cache generation. @@ -53,7 +53,7 @@ This run owns a claimed on-demand cache generation. readonly protocol: "@tanstack/db/sync-persistence"; ``` -Defined in: [packages/db/src/types.ts:551](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L551) +Defined in: [packages/db/src/types.ts:573](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L573) *** @@ -63,7 +63,7 @@ Defined in: [packages/db/src/types.ts:551](https://github.com/TanStack/db/blob/m readonly reserveCommitTurn: () => void; ``` -Defined in: [packages/db/src/types.ts:567](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L567) +Defined in: [packages/db/src/types.ts:589](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L589) Reserve the open sync transaction's FIFO turn, so a subset hydration that starts before it commits waits for that commit. @@ -80,7 +80,7 @@ that starts before it commits waits for that commit. readonly resumeSnapshot: object; ``` -Defined in: [packages/db/src/types.ts:571](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L571) +Defined in: [packages/db/src/types.ts:593](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L593) #### certify() @@ -123,7 +123,7 @@ readonly getKeySetEvidence: () => readonly scanPersistedRows: (options?) => Promise[]>; ``` -Defined in: [packages/db/src/types.ts:568](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L568) +Defined in: [packages/db/src/types.ts:590](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L590) #### Parameters @@ -143,7 +143,7 @@ Defined in: [packages/db/src/types.ts:568](https://github.com/TanStack/db/blob/m readonly optional startScopedRecovery: (resetMetadata?) => Promise; ``` -Defined in: [packages/db/src/types.ts:559](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L559) +Defined in: [packages/db/src/types.ts:581](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L581) Retire untrusted on-demand rows and retain the provider's reset metadata. @@ -171,7 +171,7 @@ Retire untrusted on-demand rows and retain the provider's reset metadata. readonly optional startupCacheGenerationRotated: boolean; ``` -Defined in: [packages/db/src/types.ts:556](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L556) +Defined in: [packages/db/src/types.ts:578](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L578) The on-demand cache generation rotated before the source sync run entered. @@ -183,4 +183,4 @@ The on-demand cache generation rotated before the source sync run entered. readonly version: 1; ``` -Defined in: [packages/db/src/types.ts:552](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L552) +Defined in: [packages/db/src/types.ts:574](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L574) diff --git a/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md b/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md index 7ff3bd2115..e06541f940 100644 --- a/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md +++ b/docs/reference/type-aliases/SyncPersistenceKeySetEvidence.md @@ -7,7 +7,7 @@ title: SyncPersistenceKeySetEvidence type SyncPersistenceKeySetEvidence = object; ``` -Defined in: [packages/db/src/types.ts:529](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L529) +Defined in: [packages/db/src/types.ts:551](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L551) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:529](https://github.com/TanStack/db/blob/m status: "unknown" | "consistent" | "incompatible"; ``` -Defined in: [packages/db/src/types.ts:530](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L530) +Defined in: [packages/db/src/types.ts:552](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L552) diff --git a/docs/reference/type-aliases/SyncPersistenceScanOptions.md b/docs/reference/type-aliases/SyncPersistenceScanOptions.md index 3205671fb0..33c026beb1 100644 --- a/docs/reference/type-aliases/SyncPersistenceScanOptions.md +++ b/docs/reference/type-aliases/SyncPersistenceScanOptions.md @@ -7,7 +7,7 @@ title: SyncPersistenceScanOptions type SyncPersistenceScanOptions = object; ``` -Defined in: [packages/db/src/types.ts:533](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L533) +Defined in: [packages/db/src/types.ts:555](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L555) ## Properties @@ -17,4 +17,4 @@ Defined in: [packages/db/src/types.ts:533](https://github.com/TanStack/db/blob/m optional metadataOnly: boolean; ``` -Defined in: [packages/db/src/types.ts:534](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L534) +Defined in: [packages/db/src/types.ts:556](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L556) diff --git a/docs/reference/type-aliases/SyncPersistenceScannedRow.md b/docs/reference/type-aliases/SyncPersistenceScannedRow.md index b6e5a26221..e7de2b322d 100644 --- a/docs/reference/type-aliases/SyncPersistenceScannedRow.md +++ b/docs/reference/type-aliases/SyncPersistenceScannedRow.md @@ -7,7 +7,7 @@ title: SyncPersistenceScannedRow type SyncPersistenceScannedRow = object; ``` -Defined in: [packages/db/src/types.ts:537](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L537) +Defined in: [packages/db/src/types.ts:559](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L559) ## Type Parameters @@ -23,7 +23,7 @@ Defined in: [packages/db/src/types.ts:537](https://github.com/TanStack/db/blob/m key: TKey; ``` -Defined in: [packages/db/src/types.ts:540](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L540) +Defined in: [packages/db/src/types.ts:562](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L562) *** @@ -33,7 +33,7 @@ Defined in: [packages/db/src/types.ts:540](https://github.com/TanStack/db/blob/m optional metadata: unknown; ``` -Defined in: [packages/db/src/types.ts:542](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L542) +Defined in: [packages/db/src/types.ts:564](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L564) *** @@ -43,4 +43,4 @@ Defined in: [packages/db/src/types.ts:542](https://github.com/TanStack/db/blob/m value: object; ``` -Defined in: [packages/db/src/types.ts:541](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L541) +Defined in: [packages/db/src/types.ts:563](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L563) diff --git a/docs/reference/type-aliases/UnloadSubsetFn.md b/docs/reference/type-aliases/UnloadSubsetFn.md index f6d3f6b4a1..8d4804d6eb 100644 --- a/docs/reference/type-aliases/UnloadSubsetFn.md +++ b/docs/reference/type-aliases/UnloadSubsetFn.md @@ -7,7 +7,7 @@ title: UnloadSubsetFn type UnloadSubsetFn = (options) => void; ``` -Defined in: [packages/db/src/types.ts:403](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L403) +Defined in: [packages/db/src/types.ts:417](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L417) Releases the exact acquisition created for `options`. diff --git a/docs/reference/type-aliases/UpdateMutationFn.md b/docs/reference/type-aliases/UpdateMutationFn.md index 745eac2e87..1f8fc13ed8 100644 --- a/docs/reference/type-aliases/UpdateMutationFn.md +++ b/docs/reference/type-aliases/UpdateMutationFn.md @@ -7,7 +7,7 @@ title: UpdateMutationFn type UpdateMutationFn = (params) => Promise; ``` -Defined in: [packages/db/src/types.ts:693](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L693) +Defined in: [packages/db/src/types.ts:715](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L715) ## Type Parameters diff --git a/docs/reference/type-aliases/UpdateMutationFnParams.md b/docs/reference/type-aliases/UpdateMutationFnParams.md index 093a6529c0..4cf26a00ae 100644 --- a/docs/reference/type-aliases/UpdateMutationFnParams.md +++ b/docs/reference/type-aliases/UpdateMutationFnParams.md @@ -7,7 +7,7 @@ title: UpdateMutationFnParams type UpdateMutationFnParams = object; ``` -Defined in: [packages/db/src/types.ts:642](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L642) +Defined in: [packages/db/src/types.ts:664](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L664) ## Type Parameters @@ -31,7 +31,7 @@ Defined in: [packages/db/src/types.ts:642](https://github.com/TanStack/db/blob/m collection: Collection; ``` -Defined in: [packages/db/src/types.ts:652](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L652) +Defined in: [packages/db/src/types.ts:674](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L674) *** @@ -41,4 +41,4 @@ Defined in: [packages/db/src/types.ts:652](https://github.com/TanStack/db/blob/m transaction: TransactionWithMutations>; ``` -Defined in: [packages/db/src/types.ts:647](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L647) +Defined in: [packages/db/src/types.ts:669](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L669) diff --git a/docs/reference/type-aliases/WritableDeep.md b/docs/reference/type-aliases/WritableDeep.md index aa9493afb6..3dfd9b0505 100644 --- a/docs/reference/type-aliases/WritableDeep.md +++ b/docs/reference/type-aliases/WritableDeep.md @@ -7,7 +7,7 @@ title: WritableDeep type WritableDeep = T extends BuiltIns ? T : T extends (...arguments_) => unknown ? object extends WritableObjectDeep ? T : HasMultipleCallSignatures extends true ? T : (...arguments_) => ReturnType & WritableObjectDeep : T extends ReadonlyMap ? WritableMapDeep : T extends ReadonlySet ? WritableSetDeep : T extends ReadonlyArray ? WritableArrayDeep : T extends object ? WritableObjectDeep : unknown; ``` -Defined in: [packages/db/src/types.ts:1269](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1269) +Defined in: [packages/db/src/types.ts:1291](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L1291) ## Type Parameters