@tanstack/svelte-db 0.3.7 → 0.4.1
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.
|
@@ -3,15 +3,10 @@ import type { Collection, Context, InferResultType, InitialQueryBuilder, NonSing
|
|
|
3
3
|
type MaybeGetter<T> = T | (() => T);
|
|
4
4
|
type InfiniteQueryOptions = {
|
|
5
5
|
pageSize?: number;
|
|
6
|
+
/** First result-page label, not a server cursor or remote offset. */
|
|
6
7
|
initialPageParam?: number;
|
|
7
8
|
};
|
|
8
|
-
export type LiveInfiniteQueryConfig<
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Pagination uses the shared controller's peek-ahead strategy.
|
|
11
|
-
* This remains for compatibility with TanStack Query conventions.
|
|
12
|
-
*/
|
|
13
|
-
getNextPageParam?: (lastPage: Array<TRow>, allPages: Array<Array<TRow>>, lastPageParam: number, allPageParams: Array<number>) => number | undefined;
|
|
14
|
-
};
|
|
9
|
+
export type LiveInfiniteQueryConfig<_TRow> = InfiniteQueryOptions;
|
|
15
10
|
export type UseLiveInfiniteQueryConfig<TContext extends Context> = LiveInfiniteQueryConfig<InferResultType<TContext>[number]>;
|
|
16
11
|
export type UseLiveInfiniteQueryReturn<TContext extends Context> = Omit<ReturnType<typeof useLiveQuery<TContext>>, `data`> & {
|
|
17
12
|
data: InferResultType<TContext>;
|
|
@@ -2,6 +2,9 @@ import { assertLiveQueryWindowManyResult, compareLiveQueryWindowDependencies, cr
|
|
|
2
2
|
import { tick, untrack } from 'svelte';
|
|
3
3
|
const DEFAULT_GC_TIME_MS = 1;
|
|
4
4
|
export function useLiveInfiniteQuery(queryFnOrCollection, config, deps = []) {
|
|
5
|
+
if (`getNextPageParam` in config) {
|
|
6
|
+
throw new Error(`getNextPageParam is not supported by useLiveInfiniteQuery. Use an on-demand collection and fulfill meta.loadSubsetOptions in queryFn for server pagination.`);
|
|
7
|
+
}
|
|
5
8
|
let validatedCollection = null;
|
|
6
9
|
let previousController = null;
|
|
7
10
|
let previousInput = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/svelte-db",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
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.9.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"svelte": "^5.0.0"
|