reactjrx 1.104.0 → 1.106.0
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/dist/index.cjs +24 -12
- package/dist/index.d.ts +11 -10
- package/dist/index.js +24 -12
- package/dist/lib/queries/useMutation$.d.ts +77 -0
- package/dist/tests/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/lib/tmp/useMutation$.d.ts +0 -5
- /package/dist/lib/{queries → deprecated}/client/QueryClient.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/QueryClient.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/QueryClient.types.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/focusManager.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/focusManager.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/hashKey.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/hashKey.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/matchKey.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/matchKey.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/nanoid.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/partialMatchKey.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/partialMatchKey.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/keys/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/cache/MutationCache.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/cache/mutationCache.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/cache/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/Mutation.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/delayWhenNetworkOnline.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/executeMutation.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/mutation.options.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/observeUntilFinished.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutation/waitForNetworkOnError.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/mutations.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/observers/MutationObserver.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/observers/mutationObserver.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/observers/mutationObserver.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/observers/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/runner/MutationRunner.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/runner/mutationRunner.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/utils/defaultMutationState.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/utils/distinctUntilStateChanged.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/mutations/utils/filters.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/onlineManager.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/cache/QueryCache.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/cache/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/observer/QueryObserver.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/observer/QueryObserver.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/observer/QueryObserver.types.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/observer/queryStateHelpers.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/observer/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/Query.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/delayOnNetworkMode.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/delayUntilFocus.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/execution/completeFnIfNotMoreObservers.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/execution/executeQuery.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/getDefaultState.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/operators.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/query.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/query.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/state/whenNewData.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/query/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/retryer/CancelledError.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/retryer/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/retryer/utils.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/queries/utils.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/store.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/tests/utils.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/utils/keepPreviousData.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/client/utils/makeObservable.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/QueryClientProvider.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/QueryClientProvider.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useIsMutating.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useIsMutating.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutation.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutation.keys.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutation.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutation.switch.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutation.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutationState.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/mutations/useMutationState.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/QueryErrorResetBoundary.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/QueryOptions.rq.types.typeTest.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/errorBoundaryUtils.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/isRestoring.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/queryOptions.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/types.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useBaseQuery.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useForeverQuery.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useIsFetching.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useIsFetching.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.deduplication.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.invalidation.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.keys.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.rq.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.rq.types.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/queries/useQuery.test.d.ts +0 -0
- /package/dist/lib/{queries → deprecated}/react/useQueryClient.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useMutation.test.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useQuery$.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useQuery.cleanup.test.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useQuery.deduplication.test.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useQuery.invalidation.test.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useQuery.keys.test.d.ts +0 -0
- /package/dist/lib/{tmp → queries}/useQuery.test.d.ts +0 -0
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,9 @@ function useObserve(source$, optionsOrDeps, maybeDeps) {
|
|
|
71
71
|
);
|
|
72
72
|
const sourceRef = useLiveRef(source$);
|
|
73
73
|
const optionsRef = useLiveRef(options);
|
|
74
|
+
const getSnapshot = React.useCallback(() => {
|
|
75
|
+
return valueRef.current;
|
|
76
|
+
}, []);
|
|
74
77
|
const subscribe = React.useCallback(
|
|
75
78
|
(next) => {
|
|
76
79
|
const source = sourceRef.current;
|
|
@@ -100,10 +103,7 @@ function useObserve(source$, optionsOrDeps, maybeDeps) {
|
|
|
100
103
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
101
104
|
[...deps]
|
|
102
105
|
);
|
|
103
|
-
const
|
|
104
|
-
return valueRef.current;
|
|
105
|
-
}, []);
|
|
106
|
-
const result = React.useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
106
|
+
const result = React.useSyncExternalStore(subscribe, getSnapshot);
|
|
107
107
|
return result;
|
|
108
108
|
}
|
|
109
109
|
function useSubscribe(source, deps = []) {
|
|
@@ -203,6 +203,13 @@ const useObservableState = (defaultValue) => {
|
|
|
203
203
|
);
|
|
204
204
|
return [subject$.current, setState, subject.current.getValue()];
|
|
205
205
|
};
|
|
206
|
+
const useLiveBehaviorSubject = (state) => {
|
|
207
|
+
const subject = useBehaviorSubject(state);
|
|
208
|
+
React.useEffect(() => {
|
|
209
|
+
subject.current.next(state);
|
|
210
|
+
}, [state, subject]);
|
|
211
|
+
return subject;
|
|
212
|
+
};
|
|
206
213
|
const SIGNAL_RESET = Symbol("SIGNAL_RESET");
|
|
207
214
|
function signal(config = {}) {
|
|
208
215
|
const normalizedConfig = {
|
|
@@ -357,13 +364,6 @@ const createLocalStorageAdapter = ({
|
|
|
357
364
|
}
|
|
358
365
|
};
|
|
359
366
|
};
|
|
360
|
-
const useLiveBehaviorSubject = (state) => {
|
|
361
|
-
const subject = useBehaviorSubject(state);
|
|
362
|
-
React.useEffect(() => {
|
|
363
|
-
subject.current.next(state);
|
|
364
|
-
}, [state, subject]);
|
|
365
|
-
return subject;
|
|
366
|
-
};
|
|
367
367
|
const IDENTIFIER_PERSISTANCE_KEY = "__reactjrx";
|
|
368
368
|
const getNormalizedPersistanceValue = (unknownValue) => {
|
|
369
369
|
if (typeof unknownValue === "object" && unknownValue !== null && IDENTIFIER_PERSISTANCE_KEY in unknownValue && unknownValue[IDENTIFIER_PERSISTANCE_KEY] === IDENTIFIER_PERSISTANCE_KEY) {
|
|
@@ -709,6 +709,13 @@ function useQuery$(options, queryClient) {
|
|
|
709
709
|
return result;
|
|
710
710
|
}
|
|
711
711
|
function useMutation$(options, queryClient) {
|
|
712
|
+
const stateSubject = useBehaviorSubject({
|
|
713
|
+
status: "idle",
|
|
714
|
+
isPending: false,
|
|
715
|
+
isError: false,
|
|
716
|
+
isSuccess: false,
|
|
717
|
+
isIdle: true
|
|
718
|
+
});
|
|
712
719
|
const mutationFnAsync = (variables) => {
|
|
713
720
|
let lastData;
|
|
714
721
|
return new Promise((resolve, reject) => {
|
|
@@ -735,7 +742,11 @@ function useMutation$(options, queryClient) {
|
|
|
735
742
|
},
|
|
736
743
|
queryClient
|
|
737
744
|
);
|
|
738
|
-
|
|
745
|
+
const { status, isPending, isError, isSuccess, isIdle } = result;
|
|
746
|
+
React.useEffect(() => {
|
|
747
|
+
stateSubject.current.next({ status, isPending, isError, isSuccess, isIdle });
|
|
748
|
+
}, [status, isPending, isError, isSuccess, isIdle, stateSubject]);
|
|
749
|
+
return { ...result, state$: stateSubject.current };
|
|
739
750
|
}
|
|
740
751
|
function hasObjectPrototype(o) {
|
|
741
752
|
return Object.prototype.toString.call(o) === "[object Object]";
|
|
@@ -3501,6 +3512,7 @@ exports.signal = signal;
|
|
|
3501
3512
|
exports.useBehaviorSubject = useBehaviorSubject;
|
|
3502
3513
|
exports.useEffectOnce = useEffectOnce;
|
|
3503
3514
|
exports.useForeverQuery = useForeverQuery;
|
|
3515
|
+
exports.useLiveBehaviorSubject = useLiveBehaviorSubject;
|
|
3504
3516
|
exports.useLiveRef = useLiveRef;
|
|
3505
3517
|
exports.useMount = useMount;
|
|
3506
3518
|
exports.useMutation = useMutation;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './lib/binding/useObservableEvent';
|
|
|
4
4
|
export * from './lib/binding/useObservableState';
|
|
5
5
|
export * from './lib/binding/useSubject';
|
|
6
6
|
export * from './lib/binding/useBehaviorSubject';
|
|
7
|
+
export * from './lib/binding/useLiveBehaviorSubject';
|
|
7
8
|
export * from './lib/state/signal';
|
|
8
9
|
export * from './lib/state/react/useSignalValue';
|
|
9
10
|
export * from './lib/state/react/useSignal';
|
|
@@ -13,14 +14,14 @@ export * from './lib/state/persistance/adapters/createLocalStorageAdapter';
|
|
|
13
14
|
export * from './lib/state/react/usePersistSignals';
|
|
14
15
|
export { type SignalPersistenceConfig } from './lib/state/persistance/types';
|
|
15
16
|
export * from './lib/utils';
|
|
16
|
-
export * from './lib/
|
|
17
|
-
export * from './lib/
|
|
18
|
-
export * from './lib/
|
|
19
|
-
export * from './lib/
|
|
20
|
-
export * from './lib/
|
|
21
|
-
export * from './lib/
|
|
17
|
+
export * from './lib/queries/useQuery$';
|
|
18
|
+
export * from './lib/queries/useMutation$';
|
|
19
|
+
export * from './lib/deprecated/react/mutations/useMutation';
|
|
20
|
+
export * from './lib/deprecated/react/queries/useQuery';
|
|
21
|
+
export * from './lib/deprecated/react/useQueryClient';
|
|
22
|
+
export * from './lib/deprecated/react/queries/useForeverQuery';
|
|
22
23
|
export * from './lib/binding/useSubscribeEffect';
|
|
23
|
-
export * from './lib/
|
|
24
|
-
export { QueryCache } from './lib/
|
|
25
|
-
export { QueryClientProvider } from './lib/
|
|
26
|
-
export { MutationCache } from './lib/
|
|
24
|
+
export * from './lib/deprecated/client/QueryClient';
|
|
25
|
+
export { QueryCache } from './lib/deprecated/client/queries/cache/QueryCache';
|
|
26
|
+
export { QueryClientProvider } from './lib/deprecated/react/QueryClientProvider';
|
|
27
|
+
export { MutationCache } from './lib/deprecated/client/mutations/cache/MutationCache';
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,9 @@ function useObserve(source$, optionsOrDeps, maybeDeps) {
|
|
|
53
53
|
);
|
|
54
54
|
const sourceRef = useLiveRef(source$);
|
|
55
55
|
const optionsRef = useLiveRef(options);
|
|
56
|
+
const getSnapshot = useCallback(() => {
|
|
57
|
+
return valueRef.current;
|
|
58
|
+
}, []);
|
|
56
59
|
const subscribe = useCallback(
|
|
57
60
|
(next) => {
|
|
58
61
|
const source = sourceRef.current;
|
|
@@ -82,10 +85,7 @@ function useObserve(source$, optionsOrDeps, maybeDeps) {
|
|
|
82
85
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
86
|
[...deps]
|
|
84
87
|
);
|
|
85
|
-
const
|
|
86
|
-
return valueRef.current;
|
|
87
|
-
}, []);
|
|
88
|
-
const result = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
88
|
+
const result = useSyncExternalStore(subscribe, getSnapshot);
|
|
89
89
|
return result;
|
|
90
90
|
}
|
|
91
91
|
function useSubscribe(source, deps = []) {
|
|
@@ -185,6 +185,13 @@ const useObservableState = (defaultValue) => {
|
|
|
185
185
|
);
|
|
186
186
|
return [subject$.current, setState, subject.current.getValue()];
|
|
187
187
|
};
|
|
188
|
+
const useLiveBehaviorSubject = (state) => {
|
|
189
|
+
const subject = useBehaviorSubject(state);
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
subject.current.next(state);
|
|
192
|
+
}, [state, subject]);
|
|
193
|
+
return subject;
|
|
194
|
+
};
|
|
188
195
|
const SIGNAL_RESET = Symbol("SIGNAL_RESET");
|
|
189
196
|
function signal(config = {}) {
|
|
190
197
|
const normalizedConfig = {
|
|
@@ -339,13 +346,6 @@ const createLocalStorageAdapter = ({
|
|
|
339
346
|
}
|
|
340
347
|
};
|
|
341
348
|
};
|
|
342
|
-
const useLiveBehaviorSubject = (state) => {
|
|
343
|
-
const subject = useBehaviorSubject(state);
|
|
344
|
-
useEffect(() => {
|
|
345
|
-
subject.current.next(state);
|
|
346
|
-
}, [state, subject]);
|
|
347
|
-
return subject;
|
|
348
|
-
};
|
|
349
349
|
const IDENTIFIER_PERSISTANCE_KEY = "__reactjrx";
|
|
350
350
|
const getNormalizedPersistanceValue = (unknownValue) => {
|
|
351
351
|
if (typeof unknownValue === "object" && unknownValue !== null && IDENTIFIER_PERSISTANCE_KEY in unknownValue && unknownValue[IDENTIFIER_PERSISTANCE_KEY] === IDENTIFIER_PERSISTANCE_KEY) {
|
|
@@ -691,6 +691,13 @@ function useQuery$(options, queryClient) {
|
|
|
691
691
|
return result;
|
|
692
692
|
}
|
|
693
693
|
function useMutation$(options, queryClient) {
|
|
694
|
+
const stateSubject = useBehaviorSubject({
|
|
695
|
+
status: "idle",
|
|
696
|
+
isPending: false,
|
|
697
|
+
isError: false,
|
|
698
|
+
isSuccess: false,
|
|
699
|
+
isIdle: true
|
|
700
|
+
});
|
|
694
701
|
const mutationFnAsync = (variables) => {
|
|
695
702
|
let lastData;
|
|
696
703
|
return new Promise((resolve, reject) => {
|
|
@@ -717,7 +724,11 @@ function useMutation$(options, queryClient) {
|
|
|
717
724
|
},
|
|
718
725
|
queryClient
|
|
719
726
|
);
|
|
720
|
-
|
|
727
|
+
const { status, isPending, isError, isSuccess, isIdle } = result;
|
|
728
|
+
useEffect(() => {
|
|
729
|
+
stateSubject.current.next({ status, isPending, isError, isSuccess, isIdle });
|
|
730
|
+
}, [status, isPending, isError, isSuccess, isIdle, stateSubject]);
|
|
731
|
+
return { ...result, state$: stateSubject.current };
|
|
721
732
|
}
|
|
722
733
|
function hasObjectPrototype(o) {
|
|
723
734
|
return Object.prototype.toString.call(o) === "[object Object]";
|
|
@@ -3484,6 +3495,7 @@ export {
|
|
|
3484
3495
|
useBehaviorSubject,
|
|
3485
3496
|
useEffectOnce,
|
|
3486
3497
|
useForeverQuery,
|
|
3498
|
+
useLiveBehaviorSubject,
|
|
3487
3499
|
useLiveRef,
|
|
3488
3500
|
useMount,
|
|
3489
3501
|
useMutation,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { DefaultError, QueryClient, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export declare function useMutation$<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(options: Omit<UseMutationOptions<TData, TError, TVariables, TContext>, "mutationFn"> & {
|
|
4
|
+
mutationFn: ((variables: TVariables) => Observable<TData>) | Observable<TData>;
|
|
5
|
+
}, queryClient?: QueryClient): {
|
|
6
|
+
state$: import('rxjs').BehaviorSubject<Pick<UseMutationResult<TData, TError, TVariables, TContext>, "status" | "isPending" | "isError" | "isSuccess" | "isIdle">>;
|
|
7
|
+
data: undefined;
|
|
8
|
+
variables: undefined;
|
|
9
|
+
error: null;
|
|
10
|
+
isError: false;
|
|
11
|
+
isIdle: true;
|
|
12
|
+
isPending: false;
|
|
13
|
+
isSuccess: false;
|
|
14
|
+
status: "idle";
|
|
15
|
+
mutate: import('@tanstack/react-query').UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
16
|
+
reset: () => void;
|
|
17
|
+
context: TContext | undefined;
|
|
18
|
+
failureCount: number;
|
|
19
|
+
failureReason: TError | null;
|
|
20
|
+
isPaused: boolean;
|
|
21
|
+
submittedAt: number;
|
|
22
|
+
mutateAsync: import('@tanstack/react-query').UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
23
|
+
} | {
|
|
24
|
+
state$: import('rxjs').BehaviorSubject<Pick<UseMutationResult<TData, TError, TVariables, TContext>, "status" | "isPending" | "isError" | "isSuccess" | "isIdle">>;
|
|
25
|
+
data: undefined;
|
|
26
|
+
variables: TVariables;
|
|
27
|
+
error: null;
|
|
28
|
+
isError: false;
|
|
29
|
+
isIdle: false;
|
|
30
|
+
isPending: true;
|
|
31
|
+
isSuccess: false;
|
|
32
|
+
status: "pending";
|
|
33
|
+
mutate: import('@tanstack/react-query').UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
34
|
+
reset: () => void;
|
|
35
|
+
context: TContext | undefined;
|
|
36
|
+
failureCount: number;
|
|
37
|
+
failureReason: TError | null;
|
|
38
|
+
isPaused: boolean;
|
|
39
|
+
submittedAt: number;
|
|
40
|
+
mutateAsync: import('@tanstack/react-query').UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
41
|
+
} | {
|
|
42
|
+
state$: import('rxjs').BehaviorSubject<Pick<UseMutationResult<TData, TError, TVariables, TContext>, "status" | "isPending" | "isError" | "isSuccess" | "isIdle">>;
|
|
43
|
+
data: undefined;
|
|
44
|
+
error: TError;
|
|
45
|
+
variables: TVariables;
|
|
46
|
+
isError: true;
|
|
47
|
+
isIdle: false;
|
|
48
|
+
isPending: false;
|
|
49
|
+
isSuccess: false;
|
|
50
|
+
status: "error";
|
|
51
|
+
mutate: import('@tanstack/react-query').UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
52
|
+
reset: () => void;
|
|
53
|
+
context: TContext | undefined;
|
|
54
|
+
failureCount: number;
|
|
55
|
+
failureReason: TError | null;
|
|
56
|
+
isPaused: boolean;
|
|
57
|
+
submittedAt: number;
|
|
58
|
+
mutateAsync: import('@tanstack/react-query').UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
59
|
+
} | {
|
|
60
|
+
state$: import('rxjs').BehaviorSubject<Pick<UseMutationResult<TData, TError, TVariables, TContext>, "status" | "isPending" | "isError" | "isSuccess" | "isIdle">>;
|
|
61
|
+
data: TData;
|
|
62
|
+
error: null;
|
|
63
|
+
variables: TVariables;
|
|
64
|
+
isError: false;
|
|
65
|
+
isIdle: false;
|
|
66
|
+
isPending: false;
|
|
67
|
+
isSuccess: true;
|
|
68
|
+
status: "success";
|
|
69
|
+
mutate: import('@tanstack/react-query').UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
70
|
+
reset: () => void;
|
|
71
|
+
context: TContext | undefined;
|
|
72
|
+
failureCount: number;
|
|
73
|
+
failureReason: TError | null;
|
|
74
|
+
isPaused: boolean;
|
|
75
|
+
submittedAt: number;
|
|
76
|
+
mutateAsync: import('@tanstack/react-query').UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
77
|
+
};
|
package/dist/tests/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
|
-
import { QueryClient, QueryClientConfig } from '../lib/
|
|
2
|
+
import { QueryClient, QueryClientConfig } from '../lib/deprecated/client/QueryClient';
|
|
3
3
|
import { default as React } from 'react';
|
|
4
4
|
export declare const waitForTimeout: (timeout: number) => Promise<undefined>;
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { DefaultError, QueryClient, UseMutationOptions } from '@tanstack/react-query';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
export declare function useMutation$<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(options: Omit<UseMutationOptions<TData, TError, TVariables, TContext>, "mutationFn"> & {
|
|
4
|
-
mutationFn: ((variables: TVariables) => Observable<TData>) | Observable<TData>;
|
|
5
|
-
}, queryClient?: QueryClient): import('@tanstack/react-query').UseMutationResult<TData, TError, TVariables, TContext>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/mutation/delayWhenNetworkOnline.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/mutation/mutation.options.test.d.ts
RENAMED
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/mutation/observeUntilFinished.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/mutation/waitForNetworkOnError.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/observers/mutationObserver.rq.test.d.ts
RENAMED
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/observers/mutationObserver.test.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/mutations/utils/distinctUntilStateChanged.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/{queries → deprecated}/client/queries/observer/QueryObserver.types.rq.test.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|