@tanstack/svelte-query 4.24.10 → 5.0.0-alpha.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.
- package/build/lib/{Hydrate.svelte → HydrationBoundary.svelte} +2 -1
- package/build/lib/HydrationBoundary.svelte.d.ts +21 -0
- package/build/lib/createBaseQuery.d.ts +3 -3
- package/build/lib/createBaseQuery.js +26 -22
- package/build/lib/createInfiniteQuery.d.ts +3 -5
- package/build/lib/createInfiniteQuery.js +5 -4
- package/build/lib/createMutation.d.ts +3 -6
- package/build/lib/createMutation.js +9 -9
- package/build/lib/createQueries.d.ts +12 -7
- package/build/lib/createQueries.js +12 -12
- package/build/lib/createQuery.d.ts +10 -22
- package/build/lib/createQuery.js +3 -5
- package/build/lib/index.d.ts +1 -1
- package/build/lib/index.js +1 -1
- package/build/lib/types.d.ts +16 -15
- package/build/lib/useHydrate.d.ts +2 -2
- package/build/lib/useHydrate.js +2 -2
- package/build/lib/useIsFetching.d.ts +2 -3
- package/build/lib/useIsFetching.js +3 -4
- package/build/lib/useIsMutating.d.ts +2 -3
- package/build/lib/useIsMutating.js +3 -4
- package/build/lib/useQueryClient.d.ts +1 -1
- package/build/lib/useQueryClient.js +6 -3
- package/build/lib/utils.d.ts +3 -0
- package/build/lib/utils.js +3 -0
- package/package.json +2 -2
- package/src/HydrationBoundary.svelte +16 -0
- package/src/__tests__/CreateQueries.svelte +5 -3
- package/src/__tests__/CreateQuery.svelte +14 -3
- package/src/__tests__/createQueries.test.ts +26 -22
- package/src/__tests__/createQuery.test.ts +36 -0
- package/src/__tests__/utils.ts +2 -34
- package/src/createBaseQuery.ts +47 -42
- package/src/createInfiniteQuery.ts +19 -81
- package/src/createMutation.ts +17 -72
- package/src/createQueries.ts +36 -27
- package/src/createQuery.ts +33 -107
- package/src/index.ts +1 -1
- package/src/types.ts +23 -16
- package/src/useHydrate.ts +6 -2
- package/src/useIsFetching.ts +2 -11
- package/src/useIsMutating.ts +3 -12
- package/src/useQueryClient.ts +8 -3
- package/src/utils.ts +8 -0
- package/build/lib/Hydrate.svelte.d.ts +0 -20
- package/src/Hydrate.svelte +0 -11
package/src/createQuery.ts
CHANGED
|
@@ -1,143 +1,69 @@
|
|
|
1
|
-
import { QueryObserver
|
|
2
|
-
import type {
|
|
1
|
+
import { QueryObserver } from '@tanstack/query-core'
|
|
2
|
+
import type {
|
|
3
|
+
QueryKey,
|
|
4
|
+
QueryClient,
|
|
5
|
+
RegisteredError,
|
|
6
|
+
} from '@tanstack/query-core'
|
|
3
7
|
import { createBaseQuery } from './createBaseQuery'
|
|
4
8
|
import type {
|
|
5
9
|
DefinedCreateQueryResult,
|
|
6
10
|
CreateQueryOptions,
|
|
7
11
|
CreateQueryResult,
|
|
12
|
+
WritableOrVal,
|
|
8
13
|
} from './types'
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
TQueryFnData = unknown,
|
|
12
|
-
TError = unknown,
|
|
13
|
-
TData = TQueryFnData,
|
|
14
|
-
TQueryKey extends QueryKey = QueryKey,
|
|
15
|
-
>(
|
|
16
|
-
options: Omit<
|
|
17
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
18
|
-
'initialData'
|
|
19
|
-
> & {
|
|
20
|
-
initialData?: () => undefined
|
|
21
|
-
},
|
|
22
|
-
): CreateQueryResult<TData, TError>
|
|
23
|
-
|
|
24
|
-
export function createQuery<
|
|
25
|
-
TQueryFnData = unknown,
|
|
26
|
-
TError = unknown,
|
|
27
|
-
TData = TQueryFnData,
|
|
28
|
-
TQueryKey extends QueryKey = QueryKey,
|
|
29
|
-
>(
|
|
30
|
-
options: Omit<
|
|
31
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
32
|
-
'initialData'
|
|
33
|
-
> & {
|
|
34
|
-
initialData: TQueryFnData | (() => TQueryFnData)
|
|
35
|
-
},
|
|
36
|
-
): DefinedCreateQueryResult<TData, TError>
|
|
37
|
-
|
|
38
|
-
export function createQuery<
|
|
39
|
-
TQueryFnData = unknown,
|
|
40
|
-
TError = unknown,
|
|
41
|
-
TData = TQueryFnData,
|
|
42
|
-
TQueryKey extends QueryKey = QueryKey,
|
|
43
|
-
>(
|
|
44
|
-
options: CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
45
|
-
): CreateQueryResult<TData, TError>
|
|
46
|
-
|
|
47
|
-
export function createQuery<
|
|
15
|
+
type UndefinedInitialDataOptions<
|
|
48
16
|
TQueryFnData = unknown,
|
|
49
|
-
TError =
|
|
17
|
+
TError = RegisteredError,
|
|
50
18
|
TData = TQueryFnData,
|
|
51
19
|
TQueryKey extends QueryKey = QueryKey,
|
|
52
|
-
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
56
|
-
'queryKey' | 'initialData'
|
|
57
|
-
> & { initialData?: () => undefined },
|
|
58
|
-
): CreateQueryResult<TData, TError>
|
|
20
|
+
> = CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
21
|
+
initialData?: undefined
|
|
22
|
+
}
|
|
59
23
|
|
|
60
|
-
|
|
24
|
+
type DefinedInitialDataOptions<
|
|
61
25
|
TQueryFnData = unknown,
|
|
62
|
-
TError =
|
|
26
|
+
TError = RegisteredError,
|
|
63
27
|
TData = TQueryFnData,
|
|
64
28
|
TQueryKey extends QueryKey = QueryKey,
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
69
|
-
'queryKey' | 'initialData'
|
|
70
|
-
> & { initialData: TQueryFnData | (() => TQueryFnData) },
|
|
71
|
-
): DefinedCreateQueryResult<TData, TError>
|
|
29
|
+
> = CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
30
|
+
initialData: TQueryFnData | (() => TQueryFnData)
|
|
31
|
+
}
|
|
72
32
|
|
|
73
33
|
export function createQuery<
|
|
74
34
|
TQueryFnData = unknown,
|
|
75
|
-
TError =
|
|
35
|
+
TError = RegisteredError,
|
|
76
36
|
TData = TQueryFnData,
|
|
77
37
|
TQueryKey extends QueryKey = QueryKey,
|
|
78
38
|
>(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
82
|
-
'queryKey'
|
|
39
|
+
options: WritableOrVal<
|
|
40
|
+
UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>
|
|
83
41
|
>,
|
|
42
|
+
queryClient?: QueryClient,
|
|
84
43
|
): CreateQueryResult<TData, TError>
|
|
85
44
|
|
|
86
45
|
export function createQuery<
|
|
87
46
|
TQueryFnData = unknown,
|
|
88
|
-
TError =
|
|
47
|
+
TError = RegisteredError,
|
|
89
48
|
TData = TQueryFnData,
|
|
90
49
|
TQueryKey extends QueryKey = QueryKey,
|
|
91
50
|
>(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
options?: Omit<
|
|
95
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
96
|
-
'queryKey' | 'queryFn' | 'initialData'
|
|
97
|
-
> & { initialData?: () => undefined },
|
|
98
|
-
): CreateQueryResult<TData, TError>
|
|
99
|
-
|
|
100
|
-
export function createQuery<
|
|
101
|
-
TQueryFnData = unknown,
|
|
102
|
-
TError = unknown,
|
|
103
|
-
TData = TQueryFnData,
|
|
104
|
-
TQueryKey extends QueryKey = QueryKey,
|
|
105
|
-
>(
|
|
106
|
-
queryKey: TQueryKey,
|
|
107
|
-
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
|
|
108
|
-
options?: Omit<
|
|
109
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
110
|
-
'queryKey' | 'queryFn' | 'initialData'
|
|
111
|
-
> & { initialData: TQueryFnData | (() => TQueryFnData) },
|
|
112
|
-
): DefinedCreateQueryResult<TData, TError>
|
|
113
|
-
|
|
114
|
-
export function createQuery<
|
|
115
|
-
TQueryFnData = unknown,
|
|
116
|
-
TError = unknown,
|
|
117
|
-
TData = TQueryFnData,
|
|
118
|
-
TQueryKey extends QueryKey = QueryKey,
|
|
119
|
-
>(
|
|
120
|
-
queryKey: TQueryKey,
|
|
121
|
-
queryFn: QueryFunction<TQueryFnData, TQueryKey>,
|
|
122
|
-
options?: Omit<
|
|
123
|
-
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
|
|
124
|
-
'queryKey' | 'queryFn'
|
|
51
|
+
options: WritableOrVal<
|
|
52
|
+
DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>
|
|
125
53
|
>,
|
|
126
|
-
|
|
54
|
+
queryClient?: QueryClient,
|
|
55
|
+
): DefinedCreateQueryResult<TData, TError>
|
|
127
56
|
|
|
128
57
|
export function createQuery<
|
|
129
58
|
TQueryFnData,
|
|
130
|
-
TError,
|
|
59
|
+
TError = RegisteredError,
|
|
131
60
|
TData = TQueryFnData,
|
|
132
61
|
TQueryKey extends QueryKey = QueryKey,
|
|
133
62
|
>(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const parsedOptions = parseQueryArgs(arg1, arg2, arg3)
|
|
141
|
-
const result = createBaseQuery(parsedOptions, QueryObserver)
|
|
142
|
-
return result
|
|
63
|
+
options: WritableOrVal<
|
|
64
|
+
CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>
|
|
65
|
+
>,
|
|
66
|
+
queryClient?: QueryClient,
|
|
67
|
+
) {
|
|
68
|
+
return createBaseQuery(options, QueryObserver, queryClient)
|
|
143
69
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,5 +13,5 @@ export { useQueryClient } from './useQueryClient'
|
|
|
13
13
|
export { useIsFetching } from './useIsFetching'
|
|
14
14
|
export { useIsMutating } from './useIsMutating'
|
|
15
15
|
export { useHydrate } from './useHydrate'
|
|
16
|
-
export { default as
|
|
16
|
+
export { default as HydrationBoundary } from './HydrationBoundary.svelte'
|
|
17
17
|
export { default as QueryClientProvider } from './QueryClientProvider.svelte'
|
package/src/types.ts
CHANGED
|
@@ -8,9 +8,12 @@ import type {
|
|
|
8
8
|
MutationObserverOptions,
|
|
9
9
|
MutateFunction,
|
|
10
10
|
DefinedQueryObserverResult,
|
|
11
|
+
RegisteredError,
|
|
11
12
|
} from '@tanstack/query-core'
|
|
12
13
|
import type { QueryClient } from '@tanstack/query-core'
|
|
13
|
-
import type { Readable } from 'svelte/store'
|
|
14
|
+
import type { Readable, Writable } from 'svelte/store'
|
|
15
|
+
|
|
16
|
+
export type WritableOrVal<T> = T | Writable<T>
|
|
14
17
|
|
|
15
18
|
export interface ContextOptions {
|
|
16
19
|
/**
|
|
@@ -21,19 +24,21 @@ export interface ContextOptions {
|
|
|
21
24
|
|
|
22
25
|
export interface CreateBaseQueryOptions<
|
|
23
26
|
TQueryFnData = unknown,
|
|
24
|
-
TError =
|
|
27
|
+
TError = RegisteredError,
|
|
25
28
|
TData = TQueryFnData,
|
|
26
29
|
TQueryData = TQueryFnData,
|
|
27
30
|
TQueryKey extends QueryKey = QueryKey,
|
|
28
31
|
> extends ContextOptions,
|
|
29
32
|
QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey> {}
|
|
30
33
|
|
|
31
|
-
export interface CreateBaseQueryResult<
|
|
32
|
-
|
|
34
|
+
export interface CreateBaseQueryResult<
|
|
35
|
+
TData = unknown,
|
|
36
|
+
TError = RegisteredError,
|
|
37
|
+
> extends Readable<QueryObserverResult<TData, TError>> {}
|
|
33
38
|
|
|
34
39
|
export interface CreateQueryOptions<
|
|
35
40
|
TQueryFnData = unknown,
|
|
36
|
-
TError =
|
|
41
|
+
TError = RegisteredError,
|
|
37
42
|
TData = TQueryFnData,
|
|
38
43
|
TQueryKey extends QueryKey = QueryKey,
|
|
39
44
|
> extends CreateBaseQueryOptions<
|
|
@@ -44,41 +49,43 @@ export interface CreateQueryOptions<
|
|
|
44
49
|
TQueryKey
|
|
45
50
|
> {}
|
|
46
51
|
|
|
47
|
-
export interface CreateQueryResult<TData = unknown, TError =
|
|
52
|
+
export interface CreateQueryResult<TData = unknown, TError = RegisteredError>
|
|
48
53
|
extends CreateBaseQueryResult<TData, TError> {}
|
|
49
54
|
|
|
50
55
|
export interface CreateInfiniteQueryOptions<
|
|
51
56
|
TQueryFnData = unknown,
|
|
52
|
-
TError =
|
|
57
|
+
TError = RegisteredError,
|
|
53
58
|
TData = TQueryFnData,
|
|
54
59
|
TQueryData = TQueryFnData,
|
|
55
60
|
TQueryKey extends QueryKey = QueryKey,
|
|
61
|
+
TPageParam = unknown,
|
|
56
62
|
> extends InfiniteQueryObserverOptions<
|
|
57
63
|
TQueryFnData,
|
|
58
64
|
TError,
|
|
59
65
|
TData,
|
|
60
66
|
TQueryData,
|
|
61
|
-
TQueryKey
|
|
67
|
+
TQueryKey,
|
|
68
|
+
TPageParam
|
|
62
69
|
> {}
|
|
63
70
|
|
|
64
71
|
export type CreateInfiniteQueryResult<
|
|
65
72
|
TData = unknown,
|
|
66
|
-
TError =
|
|
73
|
+
TError = RegisteredError,
|
|
67
74
|
> = Readable<InfiniteQueryObserverResult<TData, TError>>
|
|
68
75
|
|
|
69
76
|
export type DefinedCreateBaseQueryResult<
|
|
70
77
|
TData = unknown,
|
|
71
|
-
TError =
|
|
78
|
+
TError = RegisteredError,
|
|
72
79
|
> = Readable<DefinedQueryObserverResult<TData, TError>>
|
|
73
80
|
|
|
74
81
|
export type DefinedCreateQueryResult<
|
|
75
82
|
TData = unknown,
|
|
76
|
-
TError =
|
|
83
|
+
TError = RegisteredError,
|
|
77
84
|
> = DefinedCreateBaseQueryResult<TData, TError>
|
|
78
85
|
|
|
79
86
|
export interface CreateMutationOptions<
|
|
80
87
|
TData = unknown,
|
|
81
|
-
TError =
|
|
88
|
+
TError = RegisteredError,
|
|
82
89
|
TVariables = void,
|
|
83
90
|
TContext = unknown,
|
|
84
91
|
> extends ContextOptions,
|
|
@@ -89,7 +96,7 @@ export interface CreateMutationOptions<
|
|
|
89
96
|
|
|
90
97
|
export type CreateMutateFunction<
|
|
91
98
|
TData = unknown,
|
|
92
|
-
TError =
|
|
99
|
+
TError = RegisteredError,
|
|
93
100
|
TVariables = void,
|
|
94
101
|
TContext = unknown,
|
|
95
102
|
> = (
|
|
@@ -98,14 +105,14 @@ export type CreateMutateFunction<
|
|
|
98
105
|
|
|
99
106
|
export type CreateMutateAsyncFunction<
|
|
100
107
|
TData = unknown,
|
|
101
|
-
TError =
|
|
108
|
+
TError = RegisteredError,
|
|
102
109
|
TVariables = void,
|
|
103
110
|
TContext = unknown,
|
|
104
111
|
> = MutateFunction<TData, TError, TVariables, TContext>
|
|
105
112
|
|
|
106
113
|
export type CreateBaseMutationResult<
|
|
107
114
|
TData = unknown,
|
|
108
|
-
TError =
|
|
115
|
+
TError = RegisteredError,
|
|
109
116
|
TVariables = unknown,
|
|
110
117
|
TContext = unknown,
|
|
111
118
|
> = Override<
|
|
@@ -117,7 +124,7 @@ export type CreateBaseMutationResult<
|
|
|
117
124
|
|
|
118
125
|
export interface CreateMutationResult<
|
|
119
126
|
TData = unknown,
|
|
120
|
-
TError =
|
|
127
|
+
TError = RegisteredError,
|
|
121
128
|
TVariables = unknown,
|
|
122
129
|
TContext = unknown,
|
|
123
130
|
> extends Readable<
|
package/src/useHydrate.ts
CHANGED
|
@@ -5,8 +5,12 @@ import {
|
|
|
5
5
|
} from '@tanstack/query-core'
|
|
6
6
|
import { useQueryClient } from './useQueryClient'
|
|
7
7
|
|
|
8
|
-
export function useHydrate(
|
|
9
|
-
|
|
8
|
+
export function useHydrate(
|
|
9
|
+
state?: unknown,
|
|
10
|
+
options?: HydrateOptions,
|
|
11
|
+
queryClient?: QueryClient,
|
|
12
|
+
) {
|
|
13
|
+
const client = useQueryClient(queryClient)
|
|
10
14
|
|
|
11
15
|
if (state) {
|
|
12
16
|
hydrate(client, state, options)
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type QueryFilters,
|
|
3
|
-
type QueryKey,
|
|
4
3
|
type QueryClient,
|
|
5
|
-
parseFilterArgs,
|
|
6
4
|
notifyManager,
|
|
7
5
|
} from '@tanstack/query-core'
|
|
8
6
|
import { type Readable, readable } from 'svelte/store'
|
|
9
7
|
import { useQueryClient } from './useQueryClient'
|
|
10
8
|
|
|
11
|
-
export function useIsFetching(filters?: QueryFilters): Readable<number>
|
|
12
9
|
export function useIsFetching(
|
|
13
|
-
queryKey?: QueryKey,
|
|
14
10
|
filters?: QueryFilters,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export function useIsFetching(
|
|
18
|
-
arg1?: QueryKey | QueryFilters,
|
|
19
|
-
arg2?: QueryFilters,
|
|
11
|
+
queryClient?: QueryClient,
|
|
20
12
|
): Readable<number> {
|
|
21
|
-
const
|
|
22
|
-
const client: QueryClient = useQueryClient()
|
|
13
|
+
const client = useQueryClient(queryClient)
|
|
23
14
|
const cache = client.getQueryCache()
|
|
24
15
|
// isFetching is the prev value initialized on mount *
|
|
25
16
|
let isFetching = client.isFetching(filters)
|
package/src/useIsMutating.ts
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type MutationFilters,
|
|
3
|
-
type MutationKey,
|
|
4
3
|
type QueryClient,
|
|
5
4
|
notifyManager,
|
|
6
|
-
parseMutationFilterArgs,
|
|
7
5
|
} from '@tanstack/query-core'
|
|
8
6
|
import { type Readable, readable } from 'svelte/store'
|
|
9
7
|
import { useQueryClient } from './useQueryClient'
|
|
10
8
|
|
|
11
|
-
export function useIsMutating(filters?: MutationFilters): Readable<number>
|
|
12
9
|
export function useIsMutating(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
): Readable<number>
|
|
16
|
-
|
|
17
|
-
export function useIsMutating(
|
|
18
|
-
arg1?: MutationKey | MutationFilters,
|
|
19
|
-
arg2?: Omit<MutationFilters, 'mutationKey'>,
|
|
10
|
+
filters?: MutationFilters,
|
|
11
|
+
queryClient?: QueryClient,
|
|
20
12
|
): Readable<number> {
|
|
21
|
-
const
|
|
22
|
-
const client: QueryClient = useQueryClient()
|
|
13
|
+
const client = useQueryClient(queryClient)
|
|
23
14
|
const cache = client.getMutationCache()
|
|
24
15
|
// isMutating is the prev value initialized on mount *
|
|
25
16
|
let isMutating = client.isMutating(filters)
|
package/src/useQueryClient.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { QueryClient } from '@tanstack/query-core'
|
|
2
2
|
import { getQueryClientContext } from './context'
|
|
3
3
|
|
|
4
|
-
export function useQueryClient(): QueryClient {
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
export function useQueryClient(queryClient?: QueryClient): QueryClient {
|
|
5
|
+
const client = getQueryClientContext()
|
|
6
|
+
|
|
7
|
+
if (queryClient) {
|
|
8
|
+
return queryClient
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return client
|
|
7
12
|
}
|
package/src/utils.ts
ADDED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { DehydratedState, HydrateOptions } from '@tanstack/query-core';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
state: DehydratedState;
|
|
6
|
-
options?: HydrateOptions | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {
|
|
12
|
-
default: {};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export declare type HydrateProps = typeof __propDef.props;
|
|
16
|
-
export declare type HydrateEvents = typeof __propDef.events;
|
|
17
|
-
export declare type HydrateSlots = typeof __propDef.slots;
|
|
18
|
-
export default class Hydrate extends SvelteComponentTyped<HydrateProps, HydrateEvents, HydrateSlots> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
package/src/Hydrate.svelte
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { DehydratedState, HydrateOptions } from '@tanstack/query-core'
|
|
3
|
-
import { useHydrate } from './useHydrate'
|
|
4
|
-
|
|
5
|
-
export let state: DehydratedState
|
|
6
|
-
export let options: HydrateOptions | undefined = undefined
|
|
7
|
-
|
|
8
|
-
useHydrate(state, options)
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<slot />
|