tanstack-query-callbacks 0.3.0 → 0.3.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/dist/{core/index.cjs → index.cjs} +1 -1
- package/dist/{core/index.d.cts → index.d.cts} +1 -1
- package/dist/{core/index.d.ts → index.d.ts} +1 -1
- package/dist/{core/index.js → index.js} +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/svelte/index.svelte.cjs +2 -2
- package/dist/svelte/index.svelte.d.cts +1 -1
- package/dist/svelte/index.svelte.d.ts +1 -1
- package/dist/svelte/index.svelte.js +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.d.cts +1 -1
- package/dist/vue/index.d.ts +1 -1
- package/dist/vue/index.js +1 -1
- package/package.json +26 -26
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let _tanstack_query_core = require("@tanstack/query-core");
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/index.ts
|
|
5
5
|
function subscribeQueryCallbacks({ queryClient, queryKey, onSuccess, onError, onSettled }) {
|
|
6
6
|
if (!onSuccess && !onError && !onSettled) return noop;
|
|
7
7
|
return queryClient.getQueryCache().subscribe((event) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryClient, QueryKey } from "@tanstack/query-core";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/index.d.ts
|
|
4
4
|
type QuerySuccessHandler<TQueryFnData> = (data: TQueryFnData) => void;
|
|
5
5
|
type QueryErrorHandler<TError> = (err: TError) => void;
|
|
6
6
|
type QuerySettledHandler<TQueryFnData, TError> = (data: TQueryFnData | undefined, error: TError | null) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryClient, QueryKey } from "@tanstack/query-core";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/index.d.ts
|
|
4
4
|
type QuerySuccessHandler<TQueryFnData> = (data: TQueryFnData) => void;
|
|
5
5
|
type QueryErrorHandler<TError> = (err: TError) => void;
|
|
6
6
|
type QuerySettledHandler<TQueryFnData, TError> = (data: TQueryFnData | undefined, error: TError | null) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isCancelledError, matchQuery } from "@tanstack/query-core";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/index.ts
|
|
4
4
|
function subscribeQueryCallbacks({ queryClient, queryKey, onSuccess, onError, onSettled }) {
|
|
5
5
|
if (!onSuccess && !onError && !onSettled) return noop;
|
|
6
6
|
return queryClient.getQueryCache().subscribe((event) => {
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_index = require('../index.cjs');
|
|
3
3
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ let react = require("react");
|
|
|
7
7
|
function useQueryCallbacks(props) {
|
|
8
8
|
const queryClient = (0, _tanstack_react_query.useQueryClient)(props.context ? { context: props.context } : props.queryClient);
|
|
9
9
|
(0, react.useEffect)(() => {
|
|
10
|
-
return
|
|
10
|
+
return require_index.subscribeQueryCallbacks({
|
|
11
11
|
queryClient,
|
|
12
12
|
queryKey: props.queryKey,
|
|
13
13
|
onSuccess: props.onSuccess,
|
package/dist/react/index.d.cts
CHANGED
package/dist/react/index.d.ts
CHANGED
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_index = require('../index.cjs');
|
|
2
2
|
let _tanstack_svelte_query = require("@tanstack/svelte-query");
|
|
3
3
|
let svelte = require("svelte");
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ function useQueryCallbacks(props) {
|
|
|
9
9
|
$effect(() => {
|
|
10
10
|
const _queryKey = _props.queryKey;
|
|
11
11
|
const _queryClient = queryClient;
|
|
12
|
-
return (0, svelte.untrack)(() =>
|
|
12
|
+
return (0, svelte.untrack)(() => require_index.subscribeQueryCallbacks({
|
|
13
13
|
queryClient: _queryClient,
|
|
14
14
|
queryKey: _queryKey,
|
|
15
15
|
onSuccess: _props.onSuccess,
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_index = require('../index.cjs');
|
|
3
3
|
let _tanstack_vue_query = require("@tanstack/vue-query");
|
|
4
4
|
let vue_demi = require("vue-demi");
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ let vue_demi = require("vue-demi");
|
|
|
7
7
|
function useQueryCallbacks(props) {
|
|
8
8
|
const queryClient = props.queryClient ?? (props.queryClientKey ? (0, vue_demi.inject)(props.queryClientKey, void 0) : void 0) ?? (0, _tanstack_vue_query.useQueryClient)(props.queryClientId);
|
|
9
9
|
(0, vue_demi.watch)(() => (0, vue_demi.unref)(props.queryKey), (queryKey, _oldVal, onCleanup) => {
|
|
10
|
-
const unsubscribe =
|
|
10
|
+
const unsubscribe = require_index.subscribeQueryCallbacks({
|
|
11
11
|
queryClient,
|
|
12
12
|
queryKey,
|
|
13
13
|
onSuccess: props.onSuccess,
|
package/dist/vue/index.d.cts
CHANGED
package/dist/vue/index.d.ts
CHANGED
package/dist/vue/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tanstack-query-callbacks",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"author": "zhong666 <hi@zhong666.me>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/aa900031/tanstack-query-callbacks#readme",
|
|
@@ -23,12 +23,22 @@
|
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
25
|
"import": {
|
|
26
|
-
"types": "./dist/
|
|
27
|
-
"default": "./dist/
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
28
|
},
|
|
29
29
|
"require": {
|
|
30
|
-
"types": "./dist/
|
|
31
|
-
"default": "./dist/
|
|
30
|
+
"types": "./dist/index.d.cts",
|
|
31
|
+
"default": "./dist/index.cjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"./react": {
|
|
35
|
+
"import": {
|
|
36
|
+
"types": "./dist/react/index.d.ts",
|
|
37
|
+
"default": "./dist/react/index.js"
|
|
38
|
+
},
|
|
39
|
+
"require": {
|
|
40
|
+
"types": "./dist/react/index.d.cts",
|
|
41
|
+
"default": "./dist/react/index.cjs"
|
|
32
42
|
}
|
|
33
43
|
},
|
|
34
44
|
"./svelte": {
|
|
@@ -51,20 +61,11 @@
|
|
|
51
61
|
"default": "./dist/vue/index.cjs"
|
|
52
62
|
}
|
|
53
63
|
},
|
|
54
|
-
"./
|
|
55
|
-
"import": {
|
|
56
|
-
"types": "./dist/react/index.d.ts",
|
|
57
|
-
"default": "./dist/react/index.js"
|
|
58
|
-
},
|
|
59
|
-
"require": {
|
|
60
|
-
"types": "./dist/react/index.d.cts",
|
|
61
|
-
"default": "./dist/react/index.cjs"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
+
"./package.json": "./package.json"
|
|
64
65
|
},
|
|
65
|
-
"main": "dist/
|
|
66
|
-
"module": "dist/
|
|
67
|
-
"types": "dist/
|
|
66
|
+
"main": "./dist/index.cjs",
|
|
67
|
+
"module": "./dist/index.js",
|
|
68
|
+
"types": "./dist/index.d.cts",
|
|
68
69
|
"files": [
|
|
69
70
|
"dist",
|
|
70
71
|
"react.d.ts",
|
|
@@ -110,13 +111,14 @@
|
|
|
110
111
|
"devDependencies": {
|
|
111
112
|
"@aa900031/eslint-config": "^6.0.0",
|
|
112
113
|
"@aa900031/release-it-config": "^0.1.1",
|
|
113
|
-
"@
|
|
114
|
+
"@aa900031/tsdown-config": "^0.1.1",
|
|
115
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
114
116
|
"@tanstack/query-core": "^5.90.20",
|
|
115
117
|
"@tanstack/query-core-v4": "npm:@tanstack/query-core@^4.41.0",
|
|
116
|
-
"@tanstack/react-query": "^5.90.
|
|
118
|
+
"@tanstack/react-query": "^5.90.21",
|
|
117
119
|
"@tanstack/react-query-v4": "npm:@tanstack/react-query@^4.42.0",
|
|
118
120
|
"@tanstack/svelte-query": "^6.0.18",
|
|
119
|
-
"@tanstack/vue-query": "^5.
|
|
121
|
+
"@tanstack/vue-query": "^5.92.9",
|
|
120
122
|
"@tanstack/vue-query-v4": "npm:@tanstack/vue-query@^4.41.0",
|
|
121
123
|
"@testing-library/react": "14.3.1",
|
|
122
124
|
"@testing-library/svelte": "^5.2.7",
|
|
@@ -126,6 +128,7 @@
|
|
|
126
128
|
"@types/react": "^18.3.28",
|
|
127
129
|
"@types/react-dom": "^18.3.7",
|
|
128
130
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
131
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
129
132
|
"@vitest/ui": "^3.2.4",
|
|
130
133
|
"@vue/composition-api": "^1.7.2",
|
|
131
134
|
"eslint": "^9.39.3",
|
|
@@ -134,18 +137,15 @@
|
|
|
134
137
|
"react": "^18.3.1",
|
|
135
138
|
"react-dom": "^18.3.1",
|
|
136
139
|
"release-it": "^19.2.4",
|
|
137
|
-
"svelte": "^5.53.
|
|
140
|
+
"svelte": "^5.53.3",
|
|
138
141
|
"tsdown": "^0.20.0",
|
|
139
142
|
"typescript": "^5.9.3",
|
|
140
143
|
"typescript-svelte-plugin": "^0.3.50",
|
|
141
144
|
"vitest": "^3.2.4",
|
|
142
|
-
"vue": "^3.5.
|
|
145
|
+
"vue": "^3.5.29",
|
|
143
146
|
"vue-2": "npm:vue@~2.6.14",
|
|
144
147
|
"vue-2.7": "npm:vue@~2.7.16"
|
|
145
148
|
},
|
|
146
|
-
"resolutions": {
|
|
147
|
-
"vue-demi": "latest"
|
|
148
|
-
},
|
|
149
149
|
"scripts": {
|
|
150
150
|
"build": "tsdown",
|
|
151
151
|
"test": "vitest run",
|