@tanstack/solid-query 5.94.5 → 6.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/_tsup-dts-rollup.d.cts +17 -8
- package/build/_tsup-dts-rollup.d.ts +17 -8
- package/build/dev.cjs +161 -258
- package/build/dev.d.cts +1 -1
- package/build/dev.d.ts +1 -1
- package/build/dev.js +155 -252
- package/build/index.cjs +161 -258
- package/build/index.d.cts +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +155 -252
- package/package.json +9 -5
- package/src/QueryClientProvider.tsx +7 -16
- package/src/index.ts +1 -1
- package/src/isRestoring.ts +1 -2
- package/src/useBaseQuery.ts +154 -160
- package/src/useMutation.ts +32 -22
- package/src/useMutationState.ts +7 -9
- package/src/useQueries.ts +50 -116
|
@@ -3,7 +3,6 @@ import { AnyDataTag } from '@tanstack/query-core';
|
|
|
3
3
|
import { CancelledError } from '@tanstack/query-core';
|
|
4
4
|
import { CancelOptions } from '@tanstack/query-core';
|
|
5
5
|
import { Context } from 'solid-js';
|
|
6
|
-
import { ContextProviderComponent } from 'solid-js';
|
|
7
6
|
import { DataTag } from '@tanstack/query-core';
|
|
8
7
|
import { dataTagErrorSymbol } from '@tanstack/query-core';
|
|
9
8
|
import { dataTagSymbol } from '@tanstack/query-core';
|
|
@@ -56,11 +55,12 @@ import { InvalidateOptions } from '@tanstack/query-core';
|
|
|
56
55
|
import { InvalidateQueryFilters } from '@tanstack/query-core';
|
|
57
56
|
import { isCancelledError } from '@tanstack/query-core';
|
|
58
57
|
import { isServer } from '@tanstack/query-core';
|
|
59
|
-
import
|
|
58
|
+
import { JSX } from 'solid-js';
|
|
60
59
|
import { keepPreviousData } from '@tanstack/query-core';
|
|
61
60
|
import { ManagedTimerId } from '@tanstack/query-core';
|
|
62
61
|
import { matchMutation } from '@tanstack/query-core';
|
|
63
62
|
import { matchQuery } from '@tanstack/query-core';
|
|
63
|
+
import type { MockInstance } from 'vitest';
|
|
64
64
|
import { MutateFunction } from '@tanstack/query-core';
|
|
65
65
|
import { MutateOptions } from '@tanstack/query-core';
|
|
66
66
|
import { Mutation } from '@tanstack/query-core';
|
|
@@ -95,6 +95,7 @@ import { OmitKeyof } from '@tanstack/query-core';
|
|
|
95
95
|
import { onlineManager } from '@tanstack/query-core';
|
|
96
96
|
import { Options } from 'tsup';
|
|
97
97
|
import { Override } from '@tanstack/query-core';
|
|
98
|
+
import type { ParentProps } from 'solid-js';
|
|
98
99
|
import { partialMatchKey } from '@tanstack/query-core';
|
|
99
100
|
import { PlaceholderDataFunction } from '@tanstack/query-core';
|
|
100
101
|
import { QueriesObserver } from '@tanstack/query-core';
|
|
@@ -149,6 +150,10 @@ import { WithRequired } from '@tanstack/query-core';
|
|
|
149
150
|
|
|
150
151
|
export { AnyDataTag }
|
|
151
152
|
|
|
153
|
+
export declare function Blink(props: {
|
|
154
|
+
duration: number;
|
|
155
|
+
} & ParentProps): JSX;
|
|
156
|
+
|
|
152
157
|
export { CancelledError }
|
|
153
158
|
|
|
154
159
|
export { CancelOptions }
|
|
@@ -354,9 +359,9 @@ export { InvalidateQueryFilters }
|
|
|
354
359
|
|
|
355
360
|
export { isCancelledError }
|
|
356
361
|
|
|
357
|
-
declare const
|
|
358
|
-
export {
|
|
359
|
-
export {
|
|
362
|
+
declare const IsRestoringContext: Context<Accessor<boolean>>;
|
|
363
|
+
export { IsRestoringContext }
|
|
364
|
+
export { IsRestoringContext as IsRestoringContext_alias_1 }
|
|
360
365
|
|
|
361
366
|
export { isServer }
|
|
362
367
|
|
|
@@ -370,6 +375,8 @@ export { matchQuery }
|
|
|
370
375
|
|
|
371
376
|
declare type MAXIMUM_DEPTH = 20;
|
|
372
377
|
|
|
378
|
+
export declare function mockOnlineManagerIsOnline(value: boolean): MockInstance<() => boolean>;
|
|
379
|
+
|
|
373
380
|
export { MutateFunction }
|
|
374
381
|
|
|
375
382
|
export { MutateOptions }
|
|
@@ -456,7 +463,7 @@ export { QueriesObserver }
|
|
|
456
463
|
export { QueriesObserverOptions }
|
|
457
464
|
|
|
458
465
|
/**
|
|
459
|
-
* QueriesOptions reducer recursively
|
|
466
|
+
* QueriesOptions reducer recursively snapshots function arguments to infer/enforce type param
|
|
460
467
|
*/
|
|
461
468
|
declare type QueriesOptions<T extends Array<any>, TResult extends Array<any> = [], TDepth extends ReadonlyArray<number> = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array<UseQueryOptionsForUseQueries> : T extends [] ? [] : T extends [infer Head] ? [...TResult, GetOptions<Head>] : T extends [infer Head, ...infer Tail] ? QueriesOptions<[
|
|
462
469
|
...Tail
|
|
@@ -503,7 +510,7 @@ declare interface QueryClientConfig extends QueryClientConfig_2 {
|
|
|
503
510
|
export { QueryClientConfig }
|
|
504
511
|
export { QueryClientConfig as QueryClientConfig_alias_1 }
|
|
505
512
|
|
|
506
|
-
declare const QueryClientContext: Context<(() => QueryClient) |
|
|
513
|
+
declare const QueryClientContext: Context<(() => QueryClient) | null>;
|
|
507
514
|
export { QueryClientContext }
|
|
508
515
|
export { QueryClientContext as QueryClientContext_alias_1 }
|
|
509
516
|
|
|
@@ -590,6 +597,8 @@ export { ResetOptions }
|
|
|
590
597
|
|
|
591
598
|
export { ResultOptions }
|
|
592
599
|
|
|
600
|
+
export declare function setActTimeout(fn: () => void, ms?: number): NodeJS.Timeout;
|
|
601
|
+
|
|
593
602
|
export { SetDataOptions }
|
|
594
603
|
|
|
595
604
|
export { shouldThrowError }
|
|
@@ -668,7 +677,7 @@ export { UseBaseMutationResult as CreateBaseMutationResult }
|
|
|
668
677
|
export { UseBaseMutationResult }
|
|
669
678
|
export { UseBaseMutationResult as UseBaseMutationResult_alias_1 }
|
|
670
679
|
|
|
671
|
-
export declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options: Accessor<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, Observer: typeof QueryObserver, queryClient?: Accessor<QueryClient>): QueryObserverResult<TData, TError
|
|
680
|
+
export declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options: Accessor<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, Observer: typeof QueryObserver, queryClient?: Accessor<QueryClient>): Readonly<QueryObserverResult<TData, TError>>;
|
|
672
681
|
|
|
673
682
|
declare interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends OmitKeyof<QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'suspense'> {
|
|
674
683
|
/**
|
|
@@ -3,7 +3,6 @@ import { AnyDataTag } from '@tanstack/query-core';
|
|
|
3
3
|
import { CancelledError } from '@tanstack/query-core';
|
|
4
4
|
import { CancelOptions } from '@tanstack/query-core';
|
|
5
5
|
import { Context } from 'solid-js';
|
|
6
|
-
import { ContextProviderComponent } from 'solid-js';
|
|
7
6
|
import { DataTag } from '@tanstack/query-core';
|
|
8
7
|
import { dataTagErrorSymbol } from '@tanstack/query-core';
|
|
9
8
|
import { dataTagSymbol } from '@tanstack/query-core';
|
|
@@ -56,11 +55,12 @@ import { InvalidateOptions } from '@tanstack/query-core';
|
|
|
56
55
|
import { InvalidateQueryFilters } from '@tanstack/query-core';
|
|
57
56
|
import { isCancelledError } from '@tanstack/query-core';
|
|
58
57
|
import { isServer } from '@tanstack/query-core';
|
|
59
|
-
import
|
|
58
|
+
import { JSX } from 'solid-js';
|
|
60
59
|
import { keepPreviousData } from '@tanstack/query-core';
|
|
61
60
|
import { ManagedTimerId } from '@tanstack/query-core';
|
|
62
61
|
import { matchMutation } from '@tanstack/query-core';
|
|
63
62
|
import { matchQuery } from '@tanstack/query-core';
|
|
63
|
+
import type { MockInstance } from 'vitest';
|
|
64
64
|
import { MutateFunction } from '@tanstack/query-core';
|
|
65
65
|
import { MutateOptions } from '@tanstack/query-core';
|
|
66
66
|
import { Mutation } from '@tanstack/query-core';
|
|
@@ -95,6 +95,7 @@ import { OmitKeyof } from '@tanstack/query-core';
|
|
|
95
95
|
import { onlineManager } from '@tanstack/query-core';
|
|
96
96
|
import { Options } from 'tsup';
|
|
97
97
|
import { Override } from '@tanstack/query-core';
|
|
98
|
+
import type { ParentProps } from 'solid-js';
|
|
98
99
|
import { partialMatchKey } from '@tanstack/query-core';
|
|
99
100
|
import { PlaceholderDataFunction } from '@tanstack/query-core';
|
|
100
101
|
import { QueriesObserver } from '@tanstack/query-core';
|
|
@@ -149,6 +150,10 @@ import { WithRequired } from '@tanstack/query-core';
|
|
|
149
150
|
|
|
150
151
|
export { AnyDataTag }
|
|
151
152
|
|
|
153
|
+
export declare function Blink(props: {
|
|
154
|
+
duration: number;
|
|
155
|
+
} & ParentProps): JSX;
|
|
156
|
+
|
|
152
157
|
export { CancelledError }
|
|
153
158
|
|
|
154
159
|
export { CancelOptions }
|
|
@@ -354,9 +359,9 @@ export { InvalidateQueryFilters }
|
|
|
354
359
|
|
|
355
360
|
export { isCancelledError }
|
|
356
361
|
|
|
357
|
-
declare const
|
|
358
|
-
export {
|
|
359
|
-
export {
|
|
362
|
+
declare const IsRestoringContext: Context<Accessor<boolean>>;
|
|
363
|
+
export { IsRestoringContext }
|
|
364
|
+
export { IsRestoringContext as IsRestoringContext_alias_1 }
|
|
360
365
|
|
|
361
366
|
export { isServer }
|
|
362
367
|
|
|
@@ -370,6 +375,8 @@ export { matchQuery }
|
|
|
370
375
|
|
|
371
376
|
declare type MAXIMUM_DEPTH = 20;
|
|
372
377
|
|
|
378
|
+
export declare function mockOnlineManagerIsOnline(value: boolean): MockInstance<() => boolean>;
|
|
379
|
+
|
|
373
380
|
export { MutateFunction }
|
|
374
381
|
|
|
375
382
|
export { MutateOptions }
|
|
@@ -456,7 +463,7 @@ export { QueriesObserver }
|
|
|
456
463
|
export { QueriesObserverOptions }
|
|
457
464
|
|
|
458
465
|
/**
|
|
459
|
-
* QueriesOptions reducer recursively
|
|
466
|
+
* QueriesOptions reducer recursively snapshots function arguments to infer/enforce type param
|
|
460
467
|
*/
|
|
461
468
|
declare type QueriesOptions<T extends Array<any>, TResult extends Array<any> = [], TDepth extends ReadonlyArray<number> = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array<UseQueryOptionsForUseQueries> : T extends [] ? [] : T extends [infer Head] ? [...TResult, GetOptions<Head>] : T extends [infer Head, ...infer Tail] ? QueriesOptions<[
|
|
462
469
|
...Tail
|
|
@@ -503,7 +510,7 @@ declare interface QueryClientConfig extends QueryClientConfig_2 {
|
|
|
503
510
|
export { QueryClientConfig }
|
|
504
511
|
export { QueryClientConfig as QueryClientConfig_alias_1 }
|
|
505
512
|
|
|
506
|
-
declare const QueryClientContext: Context<(() => QueryClient) |
|
|
513
|
+
declare const QueryClientContext: Context<(() => QueryClient) | null>;
|
|
507
514
|
export { QueryClientContext }
|
|
508
515
|
export { QueryClientContext as QueryClientContext_alias_1 }
|
|
509
516
|
|
|
@@ -590,6 +597,8 @@ export { ResetOptions }
|
|
|
590
597
|
|
|
591
598
|
export { ResultOptions }
|
|
592
599
|
|
|
600
|
+
export declare function setActTimeout(fn: () => void, ms?: number): NodeJS.Timeout;
|
|
601
|
+
|
|
593
602
|
export { SetDataOptions }
|
|
594
603
|
|
|
595
604
|
export { shouldThrowError }
|
|
@@ -668,7 +677,7 @@ export { UseBaseMutationResult as CreateBaseMutationResult }
|
|
|
668
677
|
export { UseBaseMutationResult }
|
|
669
678
|
export { UseBaseMutationResult as UseBaseMutationResult_alias_1 }
|
|
670
679
|
|
|
671
|
-
export declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options: Accessor<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, Observer: typeof QueryObserver, queryClient?: Accessor<QueryClient>): QueryObserverResult<TData, TError
|
|
680
|
+
export declare function useBaseQuery<TQueryFnData, TError, TData, TQueryData, TQueryKey extends QueryKey>(options: Accessor<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>>, Observer: typeof QueryObserver, queryClient?: Accessor<QueryClient>): Readonly<QueryObserverResult<TData, TError>>;
|
|
672
681
|
|
|
673
682
|
declare interface UseBaseQueryOptions<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends OmitKeyof<QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, 'suspense'> {
|
|
674
683
|
/**
|