tanstack-query-callbacks 0.1.0-beta.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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/index.cjs +42 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.mjs +40 -0
- package/dist/react/index.cjs +26 -0
- package/dist/react/index.d.cts +14 -0
- package/dist/react/index.d.mts +14 -0
- package/dist/react/index.d.ts +14 -0
- package/dist/react/index.mjs +24 -0
- package/dist/vue/index.cjs +28 -0
- package/dist/vue/index.d.cts +23 -0
- package/dist/vue/index.d.mts +23 -0
- package/dist/vue/index.d.ts +23 -0
- package/dist/vue/index.mjs +26 -0
- package/package.json +101 -0
- package/react.d.ts +3 -0
- package/vue.d.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) zhong666 <hi@zhong666.me> and bouzu contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const queryCore = require('@tanstack/query-core');
|
|
4
|
+
|
|
5
|
+
function subscribeQueryCallbacks({
|
|
6
|
+
queryClient,
|
|
7
|
+
queryKey,
|
|
8
|
+
onSuccess,
|
|
9
|
+
onError,
|
|
10
|
+
onSettled
|
|
11
|
+
}) {
|
|
12
|
+
if (!onSuccess && !onError && !onSettled)
|
|
13
|
+
return noop;
|
|
14
|
+
const cache = queryClient.getQueryCache();
|
|
15
|
+
const unsubscribe = cache.subscribe((event) => {
|
|
16
|
+
if (event.type !== "updated")
|
|
17
|
+
return;
|
|
18
|
+
if (!queryCore.matchQuery({ queryKey, exact: true }, event.query))
|
|
19
|
+
return;
|
|
20
|
+
switch (event.action.type) {
|
|
21
|
+
case "success": {
|
|
22
|
+
if (!event.action.manual) {
|
|
23
|
+
onSuccess?.(event.action.data);
|
|
24
|
+
onSettled?.(event.action.data, null);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
case "error": {
|
|
29
|
+
if (!queryCore.isCancelledError(event.action.error)) {
|
|
30
|
+
onError?.(event.action.error);
|
|
31
|
+
onSettled?.(void 0, event.action.error);
|
|
32
|
+
}
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return unsubscribe;
|
|
38
|
+
}
|
|
39
|
+
function noop() {
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.subscribeQueryCallbacks = subscribeQueryCallbacks;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryClient, QueryKey } from '@tanstack/query-core';
|
|
2
|
+
|
|
3
|
+
type QuerySuccessHandler<TQueryFnData> = (data: TQueryFnData) => void;
|
|
4
|
+
type QueryErrorHandler<TError> = (err: TError) => void;
|
|
5
|
+
type QuerySettledHandler<TQueryFnData, TError> = (data: TQueryFnData | undefined, error: TError | null) => void;
|
|
6
|
+
interface QueryCallbacks<TQueryFnData, TError> {
|
|
7
|
+
onSuccess?: QuerySuccessHandler<TQueryFnData>;
|
|
8
|
+
onError?: QueryErrorHandler<TError>;
|
|
9
|
+
onSettled?: QuerySettledHandler<TQueryFnData, TError>;
|
|
10
|
+
}
|
|
11
|
+
interface SubscribeQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
12
|
+
queryClient: QueryClient;
|
|
13
|
+
queryKey: QueryKey;
|
|
14
|
+
}
|
|
15
|
+
declare function subscribeQueryCallbacks<TQueryFnData = unknown, TError = unknown>({ queryClient, queryKey, onSuccess, onError, onSettled, }: SubscribeQueryCallbacksProps<TQueryFnData, TError>): () => void;
|
|
16
|
+
|
|
17
|
+
export { type QueryCallbacks, type QueryErrorHandler, type QuerySettledHandler, type QuerySuccessHandler, type SubscribeQueryCallbacksProps, subscribeQueryCallbacks };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryClient, QueryKey } from '@tanstack/query-core';
|
|
2
|
+
|
|
3
|
+
type QuerySuccessHandler<TQueryFnData> = (data: TQueryFnData) => void;
|
|
4
|
+
type QueryErrorHandler<TError> = (err: TError) => void;
|
|
5
|
+
type QuerySettledHandler<TQueryFnData, TError> = (data: TQueryFnData | undefined, error: TError | null) => void;
|
|
6
|
+
interface QueryCallbacks<TQueryFnData, TError> {
|
|
7
|
+
onSuccess?: QuerySuccessHandler<TQueryFnData>;
|
|
8
|
+
onError?: QueryErrorHandler<TError>;
|
|
9
|
+
onSettled?: QuerySettledHandler<TQueryFnData, TError>;
|
|
10
|
+
}
|
|
11
|
+
interface SubscribeQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
12
|
+
queryClient: QueryClient;
|
|
13
|
+
queryKey: QueryKey;
|
|
14
|
+
}
|
|
15
|
+
declare function subscribeQueryCallbacks<TQueryFnData = unknown, TError = unknown>({ queryClient, queryKey, onSuccess, onError, onSettled, }: SubscribeQueryCallbacksProps<TQueryFnData, TError>): () => void;
|
|
16
|
+
|
|
17
|
+
export { type QueryCallbacks, type QueryErrorHandler, type QuerySettledHandler, type QuerySuccessHandler, type SubscribeQueryCallbacksProps, subscribeQueryCallbacks };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryClient, QueryKey } from '@tanstack/query-core';
|
|
2
|
+
|
|
3
|
+
type QuerySuccessHandler<TQueryFnData> = (data: TQueryFnData) => void;
|
|
4
|
+
type QueryErrorHandler<TError> = (err: TError) => void;
|
|
5
|
+
type QuerySettledHandler<TQueryFnData, TError> = (data: TQueryFnData | undefined, error: TError | null) => void;
|
|
6
|
+
interface QueryCallbacks<TQueryFnData, TError> {
|
|
7
|
+
onSuccess?: QuerySuccessHandler<TQueryFnData>;
|
|
8
|
+
onError?: QueryErrorHandler<TError>;
|
|
9
|
+
onSettled?: QuerySettledHandler<TQueryFnData, TError>;
|
|
10
|
+
}
|
|
11
|
+
interface SubscribeQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
12
|
+
queryClient: QueryClient;
|
|
13
|
+
queryKey: QueryKey;
|
|
14
|
+
}
|
|
15
|
+
declare function subscribeQueryCallbacks<TQueryFnData = unknown, TError = unknown>({ queryClient, queryKey, onSuccess, onError, onSettled, }: SubscribeQueryCallbacksProps<TQueryFnData, TError>): () => void;
|
|
16
|
+
|
|
17
|
+
export { type QueryCallbacks, type QueryErrorHandler, type QuerySettledHandler, type QuerySuccessHandler, type SubscribeQueryCallbacksProps, subscribeQueryCallbacks };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { matchQuery, isCancelledError } from '@tanstack/query-core';
|
|
2
|
+
|
|
3
|
+
function subscribeQueryCallbacks({
|
|
4
|
+
queryClient,
|
|
5
|
+
queryKey,
|
|
6
|
+
onSuccess,
|
|
7
|
+
onError,
|
|
8
|
+
onSettled
|
|
9
|
+
}) {
|
|
10
|
+
if (!onSuccess && !onError && !onSettled)
|
|
11
|
+
return noop;
|
|
12
|
+
const cache = queryClient.getQueryCache();
|
|
13
|
+
const unsubscribe = cache.subscribe((event) => {
|
|
14
|
+
if (event.type !== "updated")
|
|
15
|
+
return;
|
|
16
|
+
if (!matchQuery({ queryKey, exact: true }, event.query))
|
|
17
|
+
return;
|
|
18
|
+
switch (event.action.type) {
|
|
19
|
+
case "success": {
|
|
20
|
+
if (!event.action.manual) {
|
|
21
|
+
onSuccess?.(event.action.data);
|
|
22
|
+
onSettled?.(event.action.data, null);
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
case "error": {
|
|
27
|
+
if (!isCancelledError(event.action.error)) {
|
|
28
|
+
onError?.(event.action.error);
|
|
29
|
+
onSettled?.(void 0, event.action.error);
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return unsubscribe;
|
|
36
|
+
}
|
|
37
|
+
function noop() {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { subscribeQueryCallbacks };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const react = require('react');
|
|
4
|
+
const reactQuery = require('@tanstack/react-query');
|
|
5
|
+
const index = require('../index.cjs');
|
|
6
|
+
require('@tanstack/query-core');
|
|
7
|
+
|
|
8
|
+
function useQueryCallbacks(props) {
|
|
9
|
+
const queryClient = reactQuery.useQueryClient(props.queryClient);
|
|
10
|
+
react.useEffect(() => {
|
|
11
|
+
return index.subscribeQueryCallbacks({
|
|
12
|
+
queryClient,
|
|
13
|
+
queryKey: props.queryKey,
|
|
14
|
+
onSuccess: props.onSuccess,
|
|
15
|
+
onError: props.onError,
|
|
16
|
+
onSettled: props.onSettled
|
|
17
|
+
});
|
|
18
|
+
}, [
|
|
19
|
+
props.queryKey,
|
|
20
|
+
props.onSuccess,
|
|
21
|
+
props.onError,
|
|
22
|
+
props.onSettled
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.useQueryCallbacks = useQueryCallbacks;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryKey, QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { QueryCallbacks } from '../index.cjs';
|
|
3
|
+
import '@tanstack/query-core';
|
|
4
|
+
|
|
5
|
+
interface UseQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
6
|
+
queryKey: QueryKey;
|
|
7
|
+
/**
|
|
8
|
+
* QueryClient instance
|
|
9
|
+
*/
|
|
10
|
+
queryClient?: QueryClient;
|
|
11
|
+
}
|
|
12
|
+
declare function useQueryCallbacks<TQueryFnData = unknown, TError = unknown>(props: UseQueryCallbacksProps<TQueryFnData, TError>): void;
|
|
13
|
+
|
|
14
|
+
export { type UseQueryCallbacksProps, useQueryCallbacks };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryKey, QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { QueryCallbacks } from '../index.mjs';
|
|
3
|
+
import '@tanstack/query-core';
|
|
4
|
+
|
|
5
|
+
interface UseQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
6
|
+
queryKey: QueryKey;
|
|
7
|
+
/**
|
|
8
|
+
* QueryClient instance
|
|
9
|
+
*/
|
|
10
|
+
queryClient?: QueryClient;
|
|
11
|
+
}
|
|
12
|
+
declare function useQueryCallbacks<TQueryFnData = unknown, TError = unknown>(props: UseQueryCallbacksProps<TQueryFnData, TError>): void;
|
|
13
|
+
|
|
14
|
+
export { type UseQueryCallbacksProps, useQueryCallbacks };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QueryKey, QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { QueryCallbacks } from '../index.js';
|
|
3
|
+
import '@tanstack/query-core';
|
|
4
|
+
|
|
5
|
+
interface UseQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
6
|
+
queryKey: QueryKey;
|
|
7
|
+
/**
|
|
8
|
+
* QueryClient instance
|
|
9
|
+
*/
|
|
10
|
+
queryClient?: QueryClient;
|
|
11
|
+
}
|
|
12
|
+
declare function useQueryCallbacks<TQueryFnData = unknown, TError = unknown>(props: UseQueryCallbacksProps<TQueryFnData, TError>): void;
|
|
13
|
+
|
|
14
|
+
export { type UseQueryCallbacksProps, useQueryCallbacks };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { subscribeQueryCallbacks } from '../index.mjs';
|
|
4
|
+
import '@tanstack/query-core';
|
|
5
|
+
|
|
6
|
+
function useQueryCallbacks(props) {
|
|
7
|
+
const queryClient = useQueryClient(props.queryClient);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
return subscribeQueryCallbacks({
|
|
10
|
+
queryClient,
|
|
11
|
+
queryKey: props.queryKey,
|
|
12
|
+
onSuccess: props.onSuccess,
|
|
13
|
+
onError: props.onError,
|
|
14
|
+
onSettled: props.onSettled
|
|
15
|
+
});
|
|
16
|
+
}, [
|
|
17
|
+
props.queryKey,
|
|
18
|
+
props.onSuccess,
|
|
19
|
+
props.onError,
|
|
20
|
+
props.onSettled
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { useQueryCallbacks };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vueDemi = require('vue-demi');
|
|
4
|
+
const vueQuery = require('@tanstack/vue-query');
|
|
5
|
+
const index = require('../index.cjs');
|
|
6
|
+
require('@tanstack/query-core');
|
|
7
|
+
|
|
8
|
+
function useQueryCallbacks(props) {
|
|
9
|
+
const queryClient = props.queryClient ?? (props.queryClientKey ? vueDemi.inject(props.queryClientKey, void 0) : void 0) ?? vueQuery.useQueryClient(props.queryClientId);
|
|
10
|
+
vueDemi.watch(
|
|
11
|
+
() => vueDemi.unref(props.queryKey),
|
|
12
|
+
(queryKey, _oldVal, onCleanup) => {
|
|
13
|
+
const unsubscribe = index.subscribeQueryCallbacks({
|
|
14
|
+
queryClient,
|
|
15
|
+
queryKey,
|
|
16
|
+
onSuccess: props.onSuccess,
|
|
17
|
+
onError: props.onError,
|
|
18
|
+
onSettled: props.onSettled
|
|
19
|
+
});
|
|
20
|
+
onCleanup(() => {
|
|
21
|
+
unsubscribe();
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
{ immediate: true }
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.useQueryCallbacks = useQueryCallbacks;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MaybeRef } from 'vue-demi';
|
|
2
|
+
import { QueryKey, QueryClient } from '@tanstack/vue-query';
|
|
3
|
+
import { QueryCallbacks } from '../index.cjs';
|
|
4
|
+
import '@tanstack/query-core';
|
|
5
|
+
|
|
6
|
+
interface UseQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
7
|
+
queryKey: MaybeRef<QueryKey>;
|
|
8
|
+
/**
|
|
9
|
+
* QueryClient instance
|
|
10
|
+
*/
|
|
11
|
+
queryClient?: QueryClient;
|
|
12
|
+
/**
|
|
13
|
+
* QueryClient Context Key for inject
|
|
14
|
+
*/
|
|
15
|
+
queryClientKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* QueryClient ID for v5 useQueryClient()
|
|
18
|
+
*/
|
|
19
|
+
queryClientId?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function useQueryCallbacks<TQueryFnData = unknown, TError = unknown>(props: UseQueryCallbacksProps<TQueryFnData, TError>): void;
|
|
22
|
+
|
|
23
|
+
export { type UseQueryCallbacksProps, useQueryCallbacks };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MaybeRef } from 'vue-demi';
|
|
2
|
+
import { QueryKey, QueryClient } from '@tanstack/vue-query';
|
|
3
|
+
import { QueryCallbacks } from '../index.mjs';
|
|
4
|
+
import '@tanstack/query-core';
|
|
5
|
+
|
|
6
|
+
interface UseQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
7
|
+
queryKey: MaybeRef<QueryKey>;
|
|
8
|
+
/**
|
|
9
|
+
* QueryClient instance
|
|
10
|
+
*/
|
|
11
|
+
queryClient?: QueryClient;
|
|
12
|
+
/**
|
|
13
|
+
* QueryClient Context Key for inject
|
|
14
|
+
*/
|
|
15
|
+
queryClientKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* QueryClient ID for v5 useQueryClient()
|
|
18
|
+
*/
|
|
19
|
+
queryClientId?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function useQueryCallbacks<TQueryFnData = unknown, TError = unknown>(props: UseQueryCallbacksProps<TQueryFnData, TError>): void;
|
|
22
|
+
|
|
23
|
+
export { type UseQueryCallbacksProps, useQueryCallbacks };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MaybeRef } from 'vue-demi';
|
|
2
|
+
import { QueryKey, QueryClient } from '@tanstack/vue-query';
|
|
3
|
+
import { QueryCallbacks } from '../index.js';
|
|
4
|
+
import '@tanstack/query-core';
|
|
5
|
+
|
|
6
|
+
interface UseQueryCallbacksProps<TQueryFnData, TError> extends QueryCallbacks<TQueryFnData, TError> {
|
|
7
|
+
queryKey: MaybeRef<QueryKey>;
|
|
8
|
+
/**
|
|
9
|
+
* QueryClient instance
|
|
10
|
+
*/
|
|
11
|
+
queryClient?: QueryClient;
|
|
12
|
+
/**
|
|
13
|
+
* QueryClient Context Key for inject
|
|
14
|
+
*/
|
|
15
|
+
queryClientKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* QueryClient ID for v5 useQueryClient()
|
|
18
|
+
*/
|
|
19
|
+
queryClientId?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function useQueryCallbacks<TQueryFnData = unknown, TError = unknown>(props: UseQueryCallbacksProps<TQueryFnData, TError>): void;
|
|
22
|
+
|
|
23
|
+
export { type UseQueryCallbacksProps, useQueryCallbacks };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { inject, watch, unref } from 'vue-demi';
|
|
2
|
+
import { useQueryClient } from '@tanstack/vue-query';
|
|
3
|
+
import { subscribeQueryCallbacks } from '../index.mjs';
|
|
4
|
+
import '@tanstack/query-core';
|
|
5
|
+
|
|
6
|
+
function useQueryCallbacks(props) {
|
|
7
|
+
const queryClient = props.queryClient ?? (props.queryClientKey ? inject(props.queryClientKey, void 0) : void 0) ?? useQueryClient(props.queryClientId);
|
|
8
|
+
watch(
|
|
9
|
+
() => unref(props.queryKey),
|
|
10
|
+
(queryKey, _oldVal, onCleanup) => {
|
|
11
|
+
const unsubscribe = subscribeQueryCallbacks({
|
|
12
|
+
queryClient,
|
|
13
|
+
queryKey,
|
|
14
|
+
onSuccess: props.onSuccess,
|
|
15
|
+
onError: props.onError,
|
|
16
|
+
onSettled: props.onSettled
|
|
17
|
+
});
|
|
18
|
+
onCleanup(() => {
|
|
19
|
+
unsubscribe();
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
{ immediate: true }
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { useQueryCallbacks };
|
package/package.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tanstack-query-callbacks",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0-beta.0",
|
|
5
|
+
"packageManager": "pnpm@8.10.0",
|
|
6
|
+
"author": "zhong666 <hi@zhong666.me>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"tanstack",
|
|
10
|
+
"tanstack-query",
|
|
11
|
+
"vue-query",
|
|
12
|
+
"react-query"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"default": "./dist/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./dist/index.d.cts",
|
|
23
|
+
"default": "./dist/index.cjs"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./vue": {
|
|
27
|
+
"import": "./dist/vue/index.mjs",
|
|
28
|
+
"require": "./dist/vue/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./react": {
|
|
31
|
+
"import": "./dist/react/index.mjs",
|
|
32
|
+
"require": "./dist/react/index.cjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"main": "dist/index.cjs",
|
|
36
|
+
"module": "dist/index.mjs",
|
|
37
|
+
"types": "dist/index.d.ts",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"vue.d.ts",
|
|
41
|
+
"react.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@tanstack/query-core": "^5.*",
|
|
48
|
+
"@tanstack/vue-query": "^5.*",
|
|
49
|
+
"@tanstack/react-query": "^5.*",
|
|
50
|
+
"@vue/composition-api": "^1.1.0",
|
|
51
|
+
"vue": "^2.6.12 || ^3.2.0",
|
|
52
|
+
"react": "^18.0.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"@tanstack/vue-query": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"@tanstack/react-query": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"@vue/composition-api": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"vue": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"react": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@aa900031/eslint-config": "^1.0.1",
|
|
73
|
+
"@release-it/conventional-changelog": "^7.0.2",
|
|
74
|
+
"@tanstack/query-core": "^5.14.2",
|
|
75
|
+
"@tanstack/vue-query": "^5.14.2",
|
|
76
|
+
"@tanstack/react-query": "^5.14.2",
|
|
77
|
+
"@testing-library/vue": "^8.0.1",
|
|
78
|
+
"@testing-library/react": "14.1.2",
|
|
79
|
+
"@tsconfig/node18": "^18.2.2",
|
|
80
|
+
"@types/node": "^18.18.7",
|
|
81
|
+
"@types/react": "^18.2.45",
|
|
82
|
+
"@types/react-dom": "^18.2.18",
|
|
83
|
+
"conventional-changelog-unjs": "^0.1.0",
|
|
84
|
+
"eslint": "^8.52.0",
|
|
85
|
+
"happy-dom": "^12.10.3",
|
|
86
|
+
"release-it": "^16.2.1",
|
|
87
|
+
"typescript": "^5.2.2",
|
|
88
|
+
"unbuild": "^2.0.0",
|
|
89
|
+
"vitest": "^1.1.0",
|
|
90
|
+
"vue": "^3.3.13",
|
|
91
|
+
"react": "^18.2.0",
|
|
92
|
+
"react-dom": "^18.2.0"
|
|
93
|
+
},
|
|
94
|
+
"scripts": {
|
|
95
|
+
"build": "unbuild",
|
|
96
|
+
"test": "vitest run",
|
|
97
|
+
"dev:test": "vitest",
|
|
98
|
+
"release": "release-it --ci",
|
|
99
|
+
"lint": "eslint . --cache --cache-location ./node_modules/.cache/eslint"
|
|
100
|
+
}
|
|
101
|
+
}
|
package/react.d.ts
ADDED
package/vue.d.ts
ADDED