@tanstack/svelte-db 0.5.1 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { untrack } from 'svelte';
|
|
3
3
|
// eslint-disable-next-line import/no-duplicates -- See https://github.com/un-ts/eslint-plugin-import-x/issues/308
|
|
4
4
|
import { SvelteMap } from 'svelte/reactivity';
|
|
5
|
-
import { BaseQueryBuilder, UnhashableQueryIRError, createLiveQueryCollection, createLiveQueryObserver, getLiveQueryHash, getStableValueHash, isCollection, isSingleResultCollection, prepareLiveQueryValue, } from '@tanstack/db';
|
|
5
|
+
import { BaseQueryBuilder, UnhashableQueryIRError, createLiveQueryCollection, createLiveQueryObserver, getLiveQueryHash, getPublicCollection, getStableValueHash, isCollection, isSingleResultCollection, prepareLiveQueryValue, resolveLiveQueryValue, } from '@tanstack/db';
|
|
6
6
|
import { useOptionalDbClient } from './db-context.js';
|
|
7
7
|
function toValue(value) {
|
|
8
8
|
if (typeof value === `function`) {
|
|
@@ -87,10 +87,8 @@ export function useLiveQuery(configOrQueryOrCollection, deps = []) {
|
|
|
87
87
|
collection = preparedValue;
|
|
88
88
|
}
|
|
89
89
|
else if (preparedValue instanceof BaseQueryBuilder) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
startSync: true,
|
|
93
|
-
});
|
|
90
|
+
// Hydration keys the live-query Collection by identity.
|
|
91
|
+
collection = resolveLiveQueryValue(preparedValue, { pool: !dbClient });
|
|
94
92
|
}
|
|
95
93
|
else {
|
|
96
94
|
collection = createLiveQueryCollection({
|
|
@@ -191,7 +189,7 @@ export function useLiveQuery(configOrQueryOrCollection, deps = []) {
|
|
|
191
189
|
return internalData;
|
|
192
190
|
},
|
|
193
191
|
get collection() {
|
|
194
|
-
return resolved.collection;
|
|
192
|
+
return getPublicCollection(resolved.collection);
|
|
195
193
|
},
|
|
196
194
|
get status() {
|
|
197
195
|
return status;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/svelte-db",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Svelte integration for @tanstack/db",
|
|
5
5
|
"author": "Kyle Mathews",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"skills"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@tanstack/db": "0.
|
|
38
|
+
"@tanstack/db": "0.12.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"svelte": "^5.0.0"
|