@tanstack/svelte-query 4.29.23 → 4.29.25
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/QueryClientProvider.svelte +1 -1
- package/build/lib/__tests__/createMutation.test.js +1 -1
- package/build/lib/__tests__/createQueries.test.js +1 -1
- package/build/lib/__tests__/createQuery.test.js +1 -1
- package/build/lib/__tests__/utils.d.ts +1 -1
- package/build/lib/context.js +1 -1
- package/build/lib/createBaseQuery.js +1 -1
- package/build/lib/createMutation.js +1 -1
- package/build/lib/createQueries.d.ts +1 -1
- package/build/lib/createQueries.js +1 -1
- package/build/lib/createQuery.d.ts +1 -1
- package/build/lib/types.d.ts +1 -1
- package/build/lib/useIsFetching.js +1 -1
- package/package.json +3 -3
- package/src/Hydrate.svelte +1 -1
- package/src/QueryClientProvider.svelte +1 -1
- package/src/context.ts +1 -1
- package/src/createBaseQuery.ts +3 -3
- package/src/createInfiniteQuery.ts +3 -3
- package/src/createMutation.ts +2 -2
- package/src/createQueries.ts +7 -8
- package/src/createQuery.ts +2 -2
- package/src/types.ts +4 -4
- package/src/useIsFetching.ts +2 -2
- package/src/useQueryClient.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { QueryClient, type QueryClientConfig
|
|
2
|
+
import { type MutationOptions, QueryClient, type QueryClientConfig } from '../index';
|
|
3
3
|
export declare function createQueryClient(config?: QueryClientConfig): QueryClient;
|
|
4
4
|
export declare function mockVisibilityState(value: DocumentVisibilityState): import("vitest/dist/index-1cfc7f58").S<[], DocumentVisibilityState>;
|
|
5
5
|
export declare function mockNavigatorOnLine(value: boolean): import("vitest/dist/index-1cfc7f58").S<[], boolean>;
|
package/build/lib/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { notifyManager, } from '@tanstack/query-core';
|
|
2
|
-
import { useQueryClient } from './useQueryClient';
|
|
3
2
|
import { derived, readable } from 'svelte/store';
|
|
3
|
+
import { useQueryClient } from './useQueryClient';
|
|
4
4
|
export function createBaseQuery(options, Observer) {
|
|
5
5
|
const queryClient = useQueryClient();
|
|
6
6
|
const defaultedOptions = queryClient.defaultQueryOptions(options);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { derived, readable } from 'svelte/store';
|
|
2
2
|
import { MutationObserver, notifyManager, parseMutationArgs, } from '@tanstack/query-core';
|
|
3
3
|
import { useQueryClient } from './useQueryClient';
|
|
4
4
|
export function createMutation(arg1, arg2, arg3) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { QueryKey, QueryFunction, QueryObserverResult } from '@tanstack/query-core';
|
|
2
1
|
import { type Readable } from 'svelte/store';
|
|
3
2
|
import type { CreateQueryOptions } from './types';
|
|
3
|
+
import type { QueryFunction, QueryKey, QueryObserverResult } from '@tanstack/query-core';
|
|
4
4
|
declare type CreateQueryOptionsForCreateQueries<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = Omit<CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'context'>;
|
|
5
5
|
declare type MAXIMUM_DEPTH = 20;
|
|
6
6
|
declare type GetOptions<T> = T extends {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueriesObserver, notifyManager } from '@tanstack/query-core';
|
|
2
2
|
import { readable } from 'svelte/store';
|
|
3
3
|
import { useQueryClient } from './useQueryClient';
|
|
4
4
|
export function createQueries(queries) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QueryFunction, QueryKey } from '@tanstack/query-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CreateQueryOptions, CreateQueryResult, DefinedCreateQueryResult } from './types';
|
|
3
3
|
export declare function createQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: Omit<CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'initialData'> & {
|
|
4
4
|
initialData?: () => undefined;
|
|
5
5
|
}): CreateQueryResult<TData, TError>;
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InfiniteQueryObserverOptions, InfiniteQueryObserverResult,
|
|
1
|
+
import type { DefinedQueryObserverResult, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, MutateFunction, MutationObserverOptions, MutationObserverResult, QueryKey, QueryObserverOptions, QueryObserverResult } from '@tanstack/query-core';
|
|
2
2
|
import type { QueryClient } from '@tanstack/query-core';
|
|
3
3
|
import type { Readable } from 'svelte/store';
|
|
4
4
|
export interface ContextOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { notifyManager, parseFilterArgs, } from '@tanstack/query-core';
|
|
2
2
|
import { readable } from 'svelte/store';
|
|
3
3
|
import { useQueryClient } from './useQueryClient';
|
|
4
4
|
export function useIsFetching(arg1, arg2) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/svelte-query",
|
|
3
|
-
"version": "4.29.
|
|
3
|
+
"version": "4.29.25",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Svelte",
|
|
5
5
|
"author": "Lachlan Collins",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"vitest": "^0.27.1"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tanstack/query-core": "4.29.
|
|
47
|
+
"@tanstack/query-core": "4.29.25"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"svelte": "
|
|
50
|
+
"svelte": ">=3 <5"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"clean": "rimraf ./build",
|
package/src/Hydrate.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { DehydratedState, HydrateOptions } from '@tanstack/query-core'
|
|
3
2
|
import { useHydrate } from './useHydrate'
|
|
3
|
+
import type { DehydratedState, HydrateOptions } from '@tanstack/query-core'
|
|
4
4
|
|
|
5
5
|
export let state: DehydratedState
|
|
6
6
|
export let options: HydrateOptions | undefined = undefined
|
package/src/context.ts
CHANGED
package/src/createBaseQuery.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
notifyManager,
|
|
3
2
|
type QueryKey,
|
|
4
3
|
type QueryObserver,
|
|
4
|
+
notifyManager,
|
|
5
5
|
} from '@tanstack/query-core'
|
|
6
|
-
import type { CreateBaseQueryOptions, CreateBaseQueryResult } from './types'
|
|
7
|
-
import { useQueryClient } from './useQueryClient'
|
|
8
6
|
import { derived, readable } from 'svelte/store'
|
|
7
|
+
import { useQueryClient } from './useQueryClient'
|
|
8
|
+
import type { CreateBaseQueryOptions, CreateBaseQueryResult } from './types'
|
|
9
9
|
|
|
10
10
|
export function createBaseQuery<
|
|
11
11
|
TQueryFnData,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InfiniteQueryObserver,
|
|
3
|
-
parseQueryArgs,
|
|
4
|
-
type QueryObserver,
|
|
5
3
|
type QueryFunction,
|
|
6
4
|
type QueryKey,
|
|
5
|
+
type QueryObserver,
|
|
6
|
+
parseQueryArgs,
|
|
7
7
|
} from '@tanstack/query-core'
|
|
8
|
+
import { createBaseQuery } from './createBaseQuery'
|
|
8
9
|
import type {
|
|
9
10
|
CreateInfiniteQueryOptions,
|
|
10
11
|
CreateInfiniteQueryResult,
|
|
11
12
|
} from './types'
|
|
12
|
-
import { createBaseQuery } from './createBaseQuery'
|
|
13
13
|
|
|
14
14
|
export function createInfiniteQuery<
|
|
15
15
|
TQueryFnData = unknown,
|
package/src/createMutation.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { derived, readable } from 'svelte/store'
|
|
2
2
|
import {
|
|
3
3
|
type MutationFunction,
|
|
4
4
|
type MutationKey,
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
notifyManager,
|
|
7
7
|
parseMutationArgs,
|
|
8
8
|
} from '@tanstack/query-core'
|
|
9
|
+
import { useQueryClient } from './useQueryClient'
|
|
9
10
|
import type {
|
|
10
11
|
CreateMutateFunction,
|
|
11
12
|
CreateMutationOptions,
|
|
12
13
|
CreateMutationResult,
|
|
13
14
|
} from './types'
|
|
14
|
-
import { useQueryClient } from './useQueryClient'
|
|
15
15
|
|
|
16
16
|
export function createMutation<
|
|
17
17
|
TData = unknown,
|
package/src/createQueries.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import { QueriesObserver, notifyManager } from '@tanstack/query-core'
|
|
2
|
+
import { type Readable, readable } from 'svelte/store'
|
|
3
|
+
|
|
4
|
+
import { useQueryClient } from './useQueryClient'
|
|
5
|
+
import type { CreateQueryOptions } from './types'
|
|
1
6
|
import type {
|
|
2
|
-
QueryKey,
|
|
3
|
-
QueryFunction,
|
|
4
7
|
QueryClient,
|
|
8
|
+
QueryFunction,
|
|
9
|
+
QueryKey,
|
|
5
10
|
QueryObserverResult,
|
|
6
11
|
} from '@tanstack/query-core'
|
|
7
12
|
|
|
8
|
-
import { notifyManager, QueriesObserver } from '@tanstack/query-core'
|
|
9
|
-
import { readable, type Readable } from 'svelte/store'
|
|
10
|
-
|
|
11
|
-
import type { CreateQueryOptions } from './types'
|
|
12
|
-
import { useQueryClient } from './useQueryClient'
|
|
13
|
-
|
|
14
13
|
// This defines the `CreateQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
|
|
15
14
|
// - `context` is omitted as it is passed as a root-level option to `createQueries` instead.
|
|
16
15
|
type CreateQueryOptionsForCreateQueries<
|
package/src/createQuery.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { QueryObserver, parseQueryArgs } from '@tanstack/query-core'
|
|
2
|
-
import type { QueryFunction, QueryKey } from '@tanstack/query-core'
|
|
3
2
|
import { createBaseQuery } from './createBaseQuery'
|
|
3
|
+
import type { QueryFunction, QueryKey } from '@tanstack/query-core'
|
|
4
4
|
import type {
|
|
5
|
-
DefinedCreateQueryResult,
|
|
6
5
|
CreateQueryOptions,
|
|
7
6
|
CreateQueryResult,
|
|
7
|
+
DefinedCreateQueryResult,
|
|
8
8
|
} from './types'
|
|
9
9
|
|
|
10
10
|
export function createQuery<
|
package/src/types.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
DefinedQueryObserverResult,
|
|
2
3
|
InfiniteQueryObserverOptions,
|
|
3
4
|
InfiniteQueryObserverResult,
|
|
5
|
+
MutateFunction,
|
|
6
|
+
MutationObserverOptions,
|
|
4
7
|
MutationObserverResult,
|
|
8
|
+
QueryKey,
|
|
5
9
|
QueryObserverOptions,
|
|
6
10
|
QueryObserverResult,
|
|
7
|
-
QueryKey,
|
|
8
|
-
MutationObserverOptions,
|
|
9
|
-
MutateFunction,
|
|
10
|
-
DefinedQueryObserverResult,
|
|
11
11
|
} from '@tanstack/query-core'
|
|
12
12
|
import type { QueryClient } from '@tanstack/query-core'
|
|
13
13
|
import type { Readable } from 'svelte/store'
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type QueryClient,
|
|
2
3
|
type QueryFilters,
|
|
3
4
|
type QueryKey,
|
|
4
|
-
type QueryClient,
|
|
5
|
-
parseFilterArgs,
|
|
6
5
|
notifyManager,
|
|
6
|
+
parseFilterArgs,
|
|
7
7
|
} from '@tanstack/query-core'
|
|
8
8
|
import { type Readable, readable } from 'svelte/store'
|
|
9
9
|
import { useQueryClient } from './useQueryClient'
|
package/src/useQueryClient.ts
CHANGED