react-query-kit 3.0.0 → 3.1.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/README.md +29 -7
- package/build/lib/router.d.ts +5 -5
- package/build/lib/router.esm.js +26 -17
- package/build/lib/router.esm.js.map +1 -1
- package/build/lib/router.js +26 -17
- package/build/lib/router.js.map +1 -1
- package/build/lib/router.mjs +26 -17
- package/build/lib/router.mjs.map +1 -1
- package/build/lib/types.d.ts +23 -15
- package/build/lib/utils.esm.js +4 -4
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +4 -4
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +4 -4
- package/build/lib/utils.mjs.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats.json +99 -99
- package/build/umd/index.development.js +30 -21
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/build/zip/zip.esm.js +1 -1
- package/package.json +2 -2
- package/src/router.ts +54 -42
- package/src/types.ts +86 -46
- package/src/utils.ts +4 -4
package/build/stats.json
CHANGED
|
@@ -10,39 +10,39 @@
|
|
|
10
10
|
"name": "src",
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
|
-
"uid": "
|
|
13
|
+
"uid": "fd7f-21",
|
|
14
14
|
"name": "utils.ts"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"uid": "
|
|
17
|
+
"uid": "fd7f-23",
|
|
18
18
|
"name": "createBaseQuery.ts"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
"uid": "
|
|
21
|
+
"uid": "fd7f-25",
|
|
22
22
|
"name": "createQuery.ts"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
"uid": "
|
|
25
|
+
"uid": "fd7f-27",
|
|
26
26
|
"name": "createSuspenseQuery.ts"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
"uid": "
|
|
29
|
+
"uid": "fd7f-29",
|
|
30
30
|
"name": "createInfiniteQuery.ts"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"uid": "
|
|
33
|
+
"uid": "fd7f-31",
|
|
34
34
|
"name": "createSuspenseInfiniteQuery.ts"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
"uid": "
|
|
37
|
+
"uid": "fd7f-33",
|
|
38
38
|
"name": "createMutation.ts"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
"uid": "
|
|
41
|
+
"uid": "fd7f-35",
|
|
42
42
|
"name": "router.ts"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
"uid": "
|
|
45
|
+
"uid": "fd7f-37",
|
|
46
46
|
"name": "index.ts"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
@@ -53,307 +53,307 @@
|
|
|
53
53
|
"isRoot": true
|
|
54
54
|
},
|
|
55
55
|
"nodeParts": {
|
|
56
|
-
"
|
|
57
|
-
"renderedLength":
|
|
58
|
-
"gzipLength":
|
|
56
|
+
"fd7f-21": {
|
|
57
|
+
"renderedLength": 894,
|
|
58
|
+
"gzipLength": 449,
|
|
59
59
|
"brotliLength": 0,
|
|
60
|
-
"mainUid": "
|
|
60
|
+
"mainUid": "fd7f-20"
|
|
61
61
|
},
|
|
62
|
-
"
|
|
62
|
+
"fd7f-23": {
|
|
63
63
|
"renderedLength": 1162,
|
|
64
64
|
"gzipLength": 397,
|
|
65
65
|
"brotliLength": 0,
|
|
66
|
-
"mainUid": "
|
|
66
|
+
"mainUid": "fd7f-22"
|
|
67
67
|
},
|
|
68
|
-
"
|
|
68
|
+
"fd7f-25": {
|
|
69
69
|
"renderedLength": 91,
|
|
70
70
|
"gzipLength": 87,
|
|
71
71
|
"brotliLength": 0,
|
|
72
|
-
"mainUid": "
|
|
72
|
+
"mainUid": "fd7f-24"
|
|
73
73
|
},
|
|
74
|
-
"
|
|
74
|
+
"fd7f-27": {
|
|
75
75
|
"renderedLength": 179,
|
|
76
76
|
"gzipLength": 118,
|
|
77
77
|
"brotliLength": 0,
|
|
78
|
-
"mainUid": "
|
|
78
|
+
"mainUid": "fd7f-26"
|
|
79
79
|
},
|
|
80
|
-
"
|
|
80
|
+
"fd7f-29": {
|
|
81
81
|
"renderedLength": 107,
|
|
82
82
|
"gzipLength": 97,
|
|
83
83
|
"brotliLength": 0,
|
|
84
|
-
"mainUid": "
|
|
84
|
+
"mainUid": "fd7f-28"
|
|
85
85
|
},
|
|
86
|
-
"
|
|
86
|
+
"fd7f-31": {
|
|
87
87
|
"renderedLength": 203,
|
|
88
88
|
"gzipLength": 128,
|
|
89
89
|
"brotliLength": 0,
|
|
90
|
-
"mainUid": "
|
|
90
|
+
"mainUid": "fd7f-30"
|
|
91
91
|
},
|
|
92
|
-
"
|
|
92
|
+
"fd7f-33": {
|
|
93
93
|
"renderedLength": 271,
|
|
94
94
|
"gzipLength": 168,
|
|
95
95
|
"brotliLength": 0,
|
|
96
|
-
"mainUid": "
|
|
96
|
+
"mainUid": "fd7f-32"
|
|
97
97
|
},
|
|
98
|
-
"
|
|
99
|
-
"renderedLength":
|
|
100
|
-
"gzipLength":
|
|
98
|
+
"fd7f-35": {
|
|
99
|
+
"renderedLength": 1152,
|
|
100
|
+
"gzipLength": 385,
|
|
101
101
|
"brotliLength": 0,
|
|
102
|
-
"mainUid": "
|
|
102
|
+
"mainUid": "fd7f-34"
|
|
103
103
|
},
|
|
104
|
-
"
|
|
104
|
+
"fd7f-37": {
|
|
105
105
|
"renderedLength": 0,
|
|
106
106
|
"gzipLength": 0,
|
|
107
107
|
"brotliLength": 0,
|
|
108
|
-
"mainUid": "
|
|
108
|
+
"mainUid": "fd7f-36"
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
"nodeMetas": {
|
|
112
|
-
"
|
|
112
|
+
"fd7f-20": {
|
|
113
113
|
"id": "/src/utils.ts",
|
|
114
114
|
"moduleParts": {
|
|
115
|
-
"zip.esm.js": "
|
|
115
|
+
"zip.esm.js": "fd7f-21"
|
|
116
116
|
},
|
|
117
117
|
"imported": [
|
|
118
118
|
{
|
|
119
|
-
"uid": "
|
|
119
|
+
"uid": "fd7f-39"
|
|
120
120
|
}
|
|
121
121
|
],
|
|
122
122
|
"importedBy": [
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "fd7f-36"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "fd7f-24"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
"uid": "
|
|
130
|
+
"uid": "fd7f-26"
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
|
-
"uid": "
|
|
133
|
+
"uid": "fd7f-28"
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
"uid": "
|
|
136
|
+
"uid": "fd7f-30"
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
|
-
"uid": "
|
|
139
|
+
"uid": "fd7f-32"
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
|
-
"uid": "
|
|
142
|
+
"uid": "fd7f-22"
|
|
143
143
|
}
|
|
144
144
|
]
|
|
145
145
|
},
|
|
146
|
-
"
|
|
146
|
+
"fd7f-22": {
|
|
147
147
|
"id": "/src/createBaseQuery.ts",
|
|
148
148
|
"moduleParts": {
|
|
149
|
-
"zip.esm.js": "
|
|
149
|
+
"zip.esm.js": "fd7f-23"
|
|
150
150
|
},
|
|
151
151
|
"imported": [
|
|
152
152
|
{
|
|
153
|
-
"uid": "
|
|
153
|
+
"uid": "fd7f-20"
|
|
154
154
|
}
|
|
155
155
|
],
|
|
156
156
|
"importedBy": [
|
|
157
157
|
{
|
|
158
|
-
"uid": "
|
|
158
|
+
"uid": "fd7f-24"
|
|
159
159
|
},
|
|
160
160
|
{
|
|
161
|
-
"uid": "
|
|
161
|
+
"uid": "fd7f-26"
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
"uid": "
|
|
164
|
+
"uid": "fd7f-28"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
|
-
"uid": "
|
|
167
|
+
"uid": "fd7f-30"
|
|
168
168
|
}
|
|
169
169
|
]
|
|
170
170
|
},
|
|
171
|
-
"
|
|
171
|
+
"fd7f-24": {
|
|
172
172
|
"id": "/src/createQuery.ts",
|
|
173
173
|
"moduleParts": {
|
|
174
|
-
"zip.esm.js": "
|
|
174
|
+
"zip.esm.js": "fd7f-25"
|
|
175
175
|
},
|
|
176
176
|
"imported": [
|
|
177
177
|
{
|
|
178
|
-
"uid": "
|
|
178
|
+
"uid": "fd7f-22"
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
|
-
"uid": "
|
|
181
|
+
"uid": "fd7f-20"
|
|
182
182
|
}
|
|
183
183
|
],
|
|
184
184
|
"importedBy": [
|
|
185
185
|
{
|
|
186
|
-
"uid": "
|
|
186
|
+
"uid": "fd7f-36"
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
|
-
"uid": "
|
|
189
|
+
"uid": "fd7f-34"
|
|
190
190
|
}
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
|
-
"
|
|
193
|
+
"fd7f-26": {
|
|
194
194
|
"id": "/src/createSuspenseQuery.ts",
|
|
195
195
|
"moduleParts": {
|
|
196
|
-
"zip.esm.js": "
|
|
196
|
+
"zip.esm.js": "fd7f-27"
|
|
197
197
|
},
|
|
198
198
|
"imported": [
|
|
199
199
|
{
|
|
200
|
-
"uid": "
|
|
200
|
+
"uid": "fd7f-22"
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
|
-
"uid": "
|
|
203
|
+
"uid": "fd7f-20"
|
|
204
204
|
}
|
|
205
205
|
],
|
|
206
206
|
"importedBy": [
|
|
207
207
|
{
|
|
208
|
-
"uid": "
|
|
208
|
+
"uid": "fd7f-36"
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
|
-
"uid": "
|
|
211
|
+
"uid": "fd7f-34"
|
|
212
212
|
}
|
|
213
213
|
]
|
|
214
214
|
},
|
|
215
|
-
"
|
|
215
|
+
"fd7f-28": {
|
|
216
216
|
"id": "/src/createInfiniteQuery.ts",
|
|
217
217
|
"moduleParts": {
|
|
218
|
-
"zip.esm.js": "
|
|
218
|
+
"zip.esm.js": "fd7f-29"
|
|
219
219
|
},
|
|
220
220
|
"imported": [
|
|
221
221
|
{
|
|
222
|
-
"uid": "
|
|
222
|
+
"uid": "fd7f-22"
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
|
-
"uid": "
|
|
225
|
+
"uid": "fd7f-20"
|
|
226
226
|
}
|
|
227
227
|
],
|
|
228
228
|
"importedBy": [
|
|
229
229
|
{
|
|
230
|
-
"uid": "
|
|
230
|
+
"uid": "fd7f-36"
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
|
-
"uid": "
|
|
233
|
+
"uid": "fd7f-34"
|
|
234
234
|
}
|
|
235
235
|
]
|
|
236
236
|
},
|
|
237
|
-
"
|
|
237
|
+
"fd7f-30": {
|
|
238
238
|
"id": "/src/createSuspenseInfiniteQuery.ts",
|
|
239
239
|
"moduleParts": {
|
|
240
|
-
"zip.esm.js": "
|
|
240
|
+
"zip.esm.js": "fd7f-31"
|
|
241
241
|
},
|
|
242
242
|
"imported": [
|
|
243
243
|
{
|
|
244
|
-
"uid": "
|
|
244
|
+
"uid": "fd7f-22"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
"uid": "
|
|
247
|
+
"uid": "fd7f-20"
|
|
248
248
|
}
|
|
249
249
|
],
|
|
250
250
|
"importedBy": [
|
|
251
251
|
{
|
|
252
|
-
"uid": "
|
|
252
|
+
"uid": "fd7f-36"
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
|
-
"uid": "
|
|
255
|
+
"uid": "fd7f-34"
|
|
256
256
|
}
|
|
257
257
|
]
|
|
258
258
|
},
|
|
259
|
-
"
|
|
259
|
+
"fd7f-32": {
|
|
260
260
|
"id": "/src/createMutation.ts",
|
|
261
261
|
"moduleParts": {
|
|
262
|
-
"zip.esm.js": "
|
|
262
|
+
"zip.esm.js": "fd7f-33"
|
|
263
263
|
},
|
|
264
264
|
"imported": [
|
|
265
265
|
{
|
|
266
|
-
"uid": "
|
|
266
|
+
"uid": "fd7f-20"
|
|
267
267
|
}
|
|
268
268
|
],
|
|
269
269
|
"importedBy": [
|
|
270
270
|
{
|
|
271
|
-
"uid": "
|
|
271
|
+
"uid": "fd7f-36"
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
|
-
"uid": "
|
|
274
|
+
"uid": "fd7f-34"
|
|
275
275
|
}
|
|
276
276
|
]
|
|
277
277
|
},
|
|
278
|
-
"
|
|
278
|
+
"fd7f-34": {
|
|
279
279
|
"id": "/src/router.ts",
|
|
280
280
|
"moduleParts": {
|
|
281
|
-
"zip.esm.js": "
|
|
281
|
+
"zip.esm.js": "fd7f-35"
|
|
282
282
|
},
|
|
283
283
|
"imported": [
|
|
284
284
|
{
|
|
285
|
-
"uid": "
|
|
285
|
+
"uid": "fd7f-28"
|
|
286
286
|
},
|
|
287
287
|
{
|
|
288
|
-
"uid": "
|
|
288
|
+
"uid": "fd7f-32"
|
|
289
289
|
},
|
|
290
290
|
{
|
|
291
|
-
"uid": "
|
|
291
|
+
"uid": "fd7f-24"
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
|
-
"uid": "
|
|
294
|
+
"uid": "fd7f-30"
|
|
295
295
|
},
|
|
296
296
|
{
|
|
297
|
-
"uid": "
|
|
297
|
+
"uid": "fd7f-26"
|
|
298
298
|
}
|
|
299
299
|
],
|
|
300
300
|
"importedBy": [
|
|
301
301
|
{
|
|
302
|
-
"uid": "
|
|
302
|
+
"uid": "fd7f-36"
|
|
303
303
|
}
|
|
304
304
|
]
|
|
305
305
|
},
|
|
306
|
-
"
|
|
306
|
+
"fd7f-36": {
|
|
307
307
|
"id": "/src/index.ts",
|
|
308
308
|
"moduleParts": {
|
|
309
|
-
"zip.esm.js": "
|
|
309
|
+
"zip.esm.js": "fd7f-37"
|
|
310
310
|
},
|
|
311
311
|
"imported": [
|
|
312
312
|
{
|
|
313
|
-
"uid": "
|
|
313
|
+
"uid": "fd7f-24"
|
|
314
314
|
},
|
|
315
315
|
{
|
|
316
|
-
"uid": "
|
|
316
|
+
"uid": "fd7f-26"
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
|
-
"uid": "
|
|
319
|
+
"uid": "fd7f-28"
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
|
-
"uid": "
|
|
322
|
+
"uid": "fd7f-30"
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
|
-
"uid": "
|
|
325
|
+
"uid": "fd7f-32"
|
|
326
326
|
},
|
|
327
327
|
{
|
|
328
|
-
"uid": "
|
|
328
|
+
"uid": "fd7f-38"
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
|
-
"uid": "
|
|
331
|
+
"uid": "fd7f-34"
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
|
-
"uid": "
|
|
334
|
+
"uid": "fd7f-20"
|
|
335
335
|
}
|
|
336
336
|
],
|
|
337
337
|
"importedBy": [],
|
|
338
338
|
"isEntry": true
|
|
339
339
|
},
|
|
340
|
-
"
|
|
340
|
+
"fd7f-38": {
|
|
341
341
|
"id": "/src/types.ts",
|
|
342
342
|
"moduleParts": {},
|
|
343
343
|
"imported": [],
|
|
344
344
|
"importedBy": [
|
|
345
345
|
{
|
|
346
|
-
"uid": "
|
|
346
|
+
"uid": "fd7f-36"
|
|
347
347
|
}
|
|
348
348
|
]
|
|
349
349
|
},
|
|
350
|
-
"
|
|
350
|
+
"fd7f-39": {
|
|
351
351
|
"id": "@tanstack/react-query",
|
|
352
352
|
"moduleParts": {},
|
|
353
353
|
"imported": [],
|
|
354
354
|
"importedBy": [
|
|
355
355
|
{
|
|
356
|
-
"uid": "
|
|
356
|
+
"uid": "fd7f-20"
|
|
357
357
|
}
|
|
358
358
|
],
|
|
359
359
|
"isExternal": true
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
const suspenseOptions = {
|
|
30
30
|
enabled: true,
|
|
31
31
|
suspense: true,
|
|
32
|
-
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
32
|
+
useErrorBoundary: (_error, query) => typeof query.state.data === 'undefined'
|
|
33
33
|
};
|
|
34
34
|
const withMiddleware = (hook, defaultOptions, type) => {
|
|
35
35
|
return function useMiddleware(options, queryClient) {
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
} = {}) => [[...u1, ...u2], { ...o1,
|
|
41
41
|
...o2
|
|
42
42
|
}], [[]]);
|
|
43
|
-
const
|
|
44
|
-
return
|
|
43
|
+
const composedHook = uses.reduceRight((next, use) => use(next), hook);
|
|
44
|
+
return composedHook(opts, queryClient);
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
const getKey = (queryKey, variables) => {
|
|
48
|
-
return variables === undefined ?
|
|
48
|
+
return typeof variables === 'undefined' ? queryKey : [...queryKey, variables];
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const createBaseQuery = (defaultOptions, useRQHook, overrideOptions) => {
|
|
@@ -134,29 +134,38 @@
|
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
const
|
|
137
|
+
const buildRouter = (keys, config) => {
|
|
138
138
|
return Object.entries(config).reduce((acc, [key, opts]) => {
|
|
139
|
-
|
|
140
|
-
[
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
139
|
+
if (!opts._type) {
|
|
140
|
+
acc[key] = buildRouter([...keys, key], opts);
|
|
141
|
+
} else {
|
|
142
|
+
const options = { ...opts,
|
|
143
|
+
[opts._type === "m" ? "mutationKey" : "queryKey"]: [...keys, key]
|
|
144
|
+
};
|
|
145
|
+
acc[key] = opts._type === "m" ? {
|
|
146
|
+
useMutation: createMutation(options),
|
|
147
|
+
...createMutation(options)
|
|
148
|
+
} : opts._type === "q" ? {
|
|
149
|
+
useQuery: createQuery(options),
|
|
150
|
+
useSuspenseQuery: createSuspenseQuery(options),
|
|
151
|
+
...createQuery(options)
|
|
152
|
+
} : {
|
|
153
|
+
useInfiniteQuery: createInfiniteQuery(options),
|
|
154
|
+
useSuspenseInfiniteQuery: createSuspenseInfiniteQuery(options),
|
|
155
|
+
...createInfiniteQuery(options)
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
154
159
|
return acc;
|
|
155
160
|
}, {
|
|
156
|
-
getKey: () =>
|
|
161
|
+
getKey: () => keys
|
|
157
162
|
});
|
|
158
163
|
};
|
|
159
164
|
|
|
165
|
+
const router = (key, config) => {
|
|
166
|
+
return buildRouter([key], config);
|
|
167
|
+
};
|
|
168
|
+
|
|
160
169
|
router.query = options => {
|
|
161
170
|
return { ...options,
|
|
162
171
|
_type: 'q'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.development.js","sources":["../../src/utils.ts","../../src/createBaseQuery.ts","../../src/createQuery.ts","../../src/createSuspenseQuery.ts","../../src/createInfiniteQuery.ts","../../src/createSuspenseInfiniteQuery.ts","../../src/createMutation.ts","../../src/router.ts"],"sourcesContent":["import * as TanstackReactQuery from '@tanstack/react-query'\nimport type { Query, QueryClient, QueryKey } from '@tanstack/react-query'\n\nimport type { Middleware } from './types'\n\nexport const ReactQuery = TanstackReactQuery\n\nexport const isV5 = !!ReactQuery.useSuspenseQuery\n\nexport const suspenseOptions = {\n enabled: true,\n suspense: true,\n useErrorBoundary: (_error: unknown, query: Query) =>\n query.state.data === undefined,\n}\n\nexport const withMiddleware = (\n hook: any,\n defaultOptions: any,\n type: 'queries' | 'mutations'\n) => {\n return function useMiddleware(\n options?: { client?: QueryClient; use?: Middleware[] },\n queryClient?: QueryClient\n ) {\n const [uses, opts]: [Middleware[], any] = [\n ReactQuery.useQueryClient(\n // @ts-ignore Compatible with ReactQuery v4\n isV5 ? queryClient : options\n ).getDefaultOptions()[type],\n defaultOptions,\n options,\n ].reduce(\n ([u1, o1], { use: u2 = [], ...o2 } = {}) => [\n [...u1, ...u2],\n { ...o1, ...o2 },\n ],\n [[]]\n )\n const composed = uses.reduceRight((next, use) => use(next), hook)\n\n return composed(opts, queryClient)\n }\n}\n\nexport const getKey = (queryKey: QueryKey, variables?: any): QueryKey => {\n return variables === undefined ? [...queryKey] : [...queryKey, variables]\n}\n","import type {\n QueryClient,\n QueryFunctionContext,\n UseBaseQueryOptions,\n UseInfiniteQueryOptions,\n} from '@tanstack/react-query'\n\nimport type { AdditionalQueryOptions, Middleware } from './types'\nimport { getKey as getFullKey, withMiddleware } from './utils'\n\ninterface CreateBaseQueryOptions\n extends Omit<UseInfiniteQueryOptions, 'queryFn'>,\n AdditionalQueryOptions<any, any> {\n use?: Middleware[]\n variables?: any\n}\n\ntype QueryBaseHookOptions = Omit<\n UseBaseQueryOptions,\n 'queryKey' | 'queryFn'\n> & {\n fetcher?: any\n variables?: any\n}\n\nexport const createBaseQuery = (\n defaultOptions: any,\n useRQHook: (options: any, queryClient?: any) => any,\n overrideOptions?: Partial<UseInfiniteQueryOptions>\n): any => {\n if (process.env.NODE_ENV !== 'production') {\n // @ts-ignore\n if (defaultOptions.useDefaultOptions) {\n console.error(\n '[Bug] useDefaultOptions is not supported, please use middleware instead.'\n )\n }\n\n // @ts-ignore\n if (defaultOptions.queryFn) {\n console.error(\n '[Bug] queryFn is not supported, please use fetcher instead.'\n )\n }\n }\n\n const {\n queryKey,\n fetcher,\n queryKeyHashFn,\n getPreviousPageParam,\n getNextPageParam,\n initialPageParam,\n } = defaultOptions as CreateBaseQueryOptions\n\n const getQueryOptions = (fetcherFn: any, variables: any) => {\n return {\n queryFn: (context: QueryFunctionContext) => fetcherFn(variables, context),\n queryKey: getFullKey(queryKey, variables),\n }\n }\n\n const getKey = (variables?: any) => getFullKey(queryKey, variables)\n\n const getOptions = (variables: any) => {\n return {\n ...defaultOptions,\n ...getQueryOptions(fetcher, variables),\n }\n }\n\n const getFetchOptions = (variables: any) => {\n return {\n queryKeyHashFn,\n getPreviousPageParam,\n getNextPageParam,\n initialPageParam,\n ...getQueryOptions(fetcher, variables),\n }\n }\n\n const useBaseHook = (\n options: QueryBaseHookOptions,\n queryClient?: QueryClient\n ) => {\n return useRQHook(\n {\n ...options,\n ...overrideOptions,\n ...getQueryOptions(options.fetcher, options.variables),\n },\n queryClient\n )\n }\n\n return Object.assign(withMiddleware(useBaseHook, defaultOptions, 'queries'), {\n fetcher,\n getKey,\n getOptions,\n getFetchOptions,\n })\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type { CompatibleError, CreateQueryOptions, QueryHook } from './types'\nimport { ReactQuery } from './utils'\n\nexport const createQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateQueryOptions<TFnData, TVariables, TError>\n): QueryHook<TFnData, TVariables, TError> => {\n return createBaseQuery(options, ReactQuery.useQuery)\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { ReactQuery, isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseQuery)\n : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions)\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateInfiniteQueryOptions,\n InfiniteQueryHook,\n} from './types'\nimport { ReactQuery } from './utils'\n\nexport const createInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n): InfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return createBaseQuery(options, ReactQuery.useInfiniteQuery)\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { ReactQuery, isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery)\n : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions)\n}\n","import type {\n CompatibleError,\n CreateMutationOptions,\n MutationHook,\n} from './types'\nimport { ReactQuery, withMiddleware } from './utils'\n\nexport const createMutation = <\n TData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n defaultOptions: CreateMutationOptions<TData, TVariables, TError, TContext>\n): MutationHook<TData, TVariables, TError, TContext> => {\n return Object.assign(\n withMiddleware(ReactQuery.useMutation, defaultOptions, 'mutations'),\n {\n getKey: () => defaultOptions.mutationKey,\n getOptions: () => defaultOptions,\n mutationFn: defaultOptions.mutationFn,\n }\n ) as MutationHook<TData, TVariables, TError, TContext>\n}\n","import { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateInfiniteQueryOptions,\n CreateMutationOptions,\n CreateQueryOptions,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterMutation,\n RouterQuery,\n} from './types'\n\nexport const router = <TConfig extends RouterConfig>(\n scope: string,\n config: TConfig\n): CreateRouter<TConfig> => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n const options: any = {\n ...opts,\n [opts._type === `m` ? `mutationKey` : `queryKey`]: [scope, key],\n }\n\n acc[key] =\n opts._type === `m`\n ? {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n : opts._type === `q`\n ? {\n useQuery: createQuery(options),\n useSuspenseQuery: createSuspenseQuery(options),\n ...createQuery(options),\n }\n : {\n useInfiniteQuery: createInfiniteQuery(options),\n useSuspenseInfiniteQuery: createSuspenseInfiniteQuery(options),\n ...createInfiniteQuery(options),\n }\n\n return acc\n },\n {\n getKey: () => [scope],\n } as any\n )\n}\n\nrouter.query = <TFnData, TVariables = void, TError = CompatibleError>(\n options: Omit<CreateQueryOptions<TFnData, TVariables, TError>, 'queryKey'>\n): RouterQuery<TFnData, TVariables, TError> => {\n return {\n ...options,\n _type: 'q',\n }\n}\n\nrouter.infiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: Omit<\n CreateInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>,\n 'queryKey'\n >\n): RouterInfiniteQuery<TFnData, TVariables, TError, TPageParam> => {\n return { ...options, _type: 'inf' }\n}\n\nrouter.mutation = <\n TFnData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n options: Omit<\n CreateMutationOptions<TFnData, TVariables, TError, TContext>,\n 'mutationKey'\n >\n): RouterMutation<TFnData, TVariables, TError, TContext> => {\n return { ...options, _type: 'm' }\n}\n"],"names":["ReactQuery","TanstackReactQuery","isV5","useSuspenseQuery","suspenseOptions","enabled","suspense","useErrorBoundary","_error","query","state","data","undefined","withMiddleware","hook","defaultOptions","type","useMiddleware","options","queryClient","uses","opts","useQueryClient","getDefaultOptions","reduce","u1","o1","use","u2","o2","composed","reduceRight","next","getKey","queryKey","variables","createBaseQuery","useRQHook","overrideOptions","useDefaultOptions","console","error","queryFn","fetcher","queryKeyHashFn","getPreviousPageParam","getNextPageParam","initialPageParam","getQueryOptions","fetcherFn","context","getFullKey","getOptions","getFetchOptions","useBaseHook","Object","assign","createQuery","useQuery","createSuspenseQuery","createInfiniteQuery","useInfiniteQuery","createSuspenseInfiniteQuery","useSuspenseInfiniteQuery","createMutation","useMutation","mutationKey","mutationFn","router","scope","config","entries","acc","key","_type","infiniteQuery","mutation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAKO,MAAMA,UAAU,GAAGC,6BAAnB,CAAA;EAEA,MAAMC,IAAI,GAAG,CAAC,CAACF,UAAU,CAACG,gBAA1B,CAAA;EAEA,MAAMC,eAAe,GAAG;EAC7BC,EAAAA,OAAO,EAAE,IADoB;EAE7BC,EAAAA,QAAQ,EAAE,IAFmB;IAG7BC,gBAAgB,EAAE,CAACC,MAAD,EAAkBC,KAAlB,KAChBA,KAAK,CAACC,KAAN,CAAYC,IAAZ,KAAqBC,SAAAA;EAJM,CAAxB,CAAA;EAOA,MAAMC,cAAc,GAAG,CAC5BC,IAD4B,EAE5BC,cAF4B,EAG5BC,IAH4B,KAIzB;EACH,EAAA,OAAO,SAASC,aAAT,CACLC,OADK,EAELC,WAFK,EAGL;MACA,MAAM,CAACC,IAAD,EAAOC,IAAP,IAAoC,CACxCrB,UAAU,CAACsB,cAAX;MAEEpB,IAAI,GAAGiB,WAAH,GAAiBD,OAFvB,EAGEK,iBAHF,EAAA,CAGsBP,IAHtB,CADwC,EAKxCD,cALwC,EAMxCG,OANwC,CAAA,CAOxCM,MAPwC,CAQxC,CAAC,CAACC,EAAD,EAAKC,EAAL,CAAD,EAAW;QAAEC,GAAG,EAAEC,EAAE,GAAG,EAAZ;QAAgB,GAAGC,EAAAA;EAAnB,KAAA,GAA0B,EAArC,KAA4C,CAC1C,CAAC,GAAGJ,EAAJ,EAAQ,GAAGG,EAAX,CAD0C,EAE1C,EAAE,GAAGF,EAAL;QAAS,GAAGG,EAAAA;EAAZ,KAF0C,CARJ,EAYxC,CAAC,EAAD,CAZwC,CAA1C,CAAA;EAcA,IAAA,MAAMC,QAAQ,GAA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AAW,CAACvC,OAAD,CADvB;EAEEf,MAAAA,gBAAgB,EAAEwD,mBAAmB,CAACzC,OAAD,CAFvC;QAGE,GAAGuC,WAAW,CAACvC,OAAD,CAAA;EAHhB,KADA,GAMA;EACE2C,MAAAA,gBAAgB,EAAED,mBAAmB,CAAC1C,OAAD,CADvC;EAEE6C,MAAAA,wBAAwB,EAAED,2BAA2B,CAAC5C,OAAD,CAFvD;QAGE,GAAG0C,mBAAmB,CAAC1C,OAAD,CAAA;OAf9B,CAAA;EAkBA,IAAA,OAAOsD,GAAP,CAAA;EACD,GA1BI,EA2BL;MACEvC,MAAM,EAAE,MAAM,CAACoC,KAAD,CAAA;EADhB,GA3BK,CAAP,CAAA;EA+BD,EAnCM;;EAqCPD,MAAM,CAAC3D,KAAP,GACES,OADa,IAEgC;IAC7C,OAAO,EACL,GAAGA,OADE;EAELwD,IAAAA,KAAK,EAAE,GAAA;KAFT,CAAA;EAID,CAPD,CAAA;;EASAN,MAAM,CAACO,aAAP,GAMEzD,OANqB,IAU4C;IACjE,OAAO,EAAE,GAAGA,OAAL;EAAcwD,IAAAA,KAAK,EAAE,KAAA;KAA5B,CAAA;EACD,CAZD,CAAA;;EAcAN,MAAM,CAACQ,QAAP,GAME1D,OANgB,IAU0C;IAC1D,OAAO,EAAE,GAAGA,OAAL;EAAcwD,IAAAA,KAAK,EAAE,GAAA;KAA5B,CAAA;EACD,CAZD;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.development.js","sources":["../../src/utils.ts","../../src/createBaseQuery.ts","../../src/createQuery.ts","../../src/createSuspenseQuery.ts","../../src/createInfiniteQuery.ts","../../src/createSuspenseInfiniteQuery.ts","../../src/createMutation.ts","../../src/router.ts"],"sourcesContent":["import * as TanstackReactQuery from '@tanstack/react-query'\nimport type { Query, QueryClient, QueryKey } from '@tanstack/react-query'\n\nimport type { Middleware } from './types'\n\nexport const ReactQuery = TanstackReactQuery\n\nexport const isV5 = !!ReactQuery.useSuspenseQuery\n\nexport const suspenseOptions = {\n enabled: true,\n suspense: true,\n useErrorBoundary: (_error: unknown, query: Query) =>\n typeof query.state.data === 'undefined',\n}\n\nexport const withMiddleware = (\n hook: any,\n defaultOptions: any,\n type: 'queries' | 'mutations'\n) => {\n return function useMiddleware(\n options?: { client?: QueryClient; use?: Middleware[] },\n queryClient?: QueryClient\n ) {\n const [uses, opts]: [Middleware[], any] = [\n ReactQuery.useQueryClient(\n // @ts-ignore Compatible with ReactQuery v4\n isV5 ? queryClient : options\n ).getDefaultOptions()[type],\n defaultOptions,\n options,\n ].reduce(\n ([u1, o1], { use: u2 = [], ...o2 } = {}) => [\n [...u1, ...u2],\n { ...o1, ...o2 },\n ],\n [[]]\n )\n const composedHook = uses.reduceRight((next, use) => use(next), hook)\n\n return composedHook(opts, queryClient)\n }\n}\n\nexport const getKey = (queryKey: QueryKey, variables?: any): QueryKey => {\n return typeof variables === 'undefined' ? queryKey : [...queryKey, variables]\n}\n","import type {\n QueryClient,\n QueryFunctionContext,\n UseBaseQueryOptions,\n UseInfiniteQueryOptions,\n} from '@tanstack/react-query'\n\nimport type { AdditionalQueryOptions, Middleware } from './types'\nimport { getKey as getFullKey, withMiddleware } from './utils'\n\ninterface CreateBaseQueryOptions\n extends Omit<UseInfiniteQueryOptions, 'queryFn'>,\n AdditionalQueryOptions<any, any> {\n use?: Middleware[]\n variables?: any\n}\n\ntype QueryBaseHookOptions = Omit<\n UseBaseQueryOptions,\n 'queryKey' | 'queryFn'\n> & {\n fetcher?: any\n variables?: any\n}\n\nexport const createBaseQuery = (\n defaultOptions: any,\n useRQHook: (options: any, queryClient?: any) => any,\n overrideOptions?: Partial<UseInfiniteQueryOptions>\n): any => {\n if (process.env.NODE_ENV !== 'production') {\n // @ts-ignore\n if (defaultOptions.useDefaultOptions) {\n console.error(\n '[Bug] useDefaultOptions is not supported, please use middleware instead.'\n )\n }\n\n // @ts-ignore\n if (defaultOptions.queryFn) {\n console.error(\n '[Bug] queryFn is not supported, please use fetcher instead.'\n )\n }\n }\n\n const {\n queryKey,\n fetcher,\n queryKeyHashFn,\n getPreviousPageParam,\n getNextPageParam,\n initialPageParam,\n } = defaultOptions as CreateBaseQueryOptions\n\n const getQueryOptions = (fetcherFn: any, variables: any) => {\n return {\n queryFn: (context: QueryFunctionContext) => fetcherFn(variables, context),\n queryKey: getFullKey(queryKey, variables),\n }\n }\n\n const getKey = (variables?: any) => getFullKey(queryKey, variables)\n\n const getOptions = (variables: any) => {\n return {\n ...defaultOptions,\n ...getQueryOptions(fetcher, variables),\n }\n }\n\n const getFetchOptions = (variables: any) => {\n return {\n queryKeyHashFn,\n getPreviousPageParam,\n getNextPageParam,\n initialPageParam,\n ...getQueryOptions(fetcher, variables),\n }\n }\n\n const useBaseHook = (\n options: QueryBaseHookOptions,\n queryClient?: QueryClient\n ) => {\n return useRQHook(\n {\n ...options,\n ...overrideOptions,\n ...getQueryOptions(options.fetcher, options.variables),\n },\n queryClient\n )\n }\n\n return Object.assign(withMiddleware(useBaseHook, defaultOptions, 'queries'), {\n fetcher,\n getKey,\n getOptions,\n getFetchOptions,\n })\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type { CompatibleError, CreateQueryOptions, QueryHook } from './types'\nimport { ReactQuery } from './utils'\n\nexport const createQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateQueryOptions<TFnData, TVariables, TError>\n): QueryHook<TFnData, TVariables, TError> => {\n return createBaseQuery(options, ReactQuery.useQuery)\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { ReactQuery, isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseQuery)\n : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions)\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateInfiniteQueryOptions,\n InfiniteQueryHook,\n} from './types'\nimport { ReactQuery } from './utils'\n\nexport const createInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n): InfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return createBaseQuery(options, ReactQuery.useInfiniteQuery)\n}\n","import { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { ReactQuery, isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery)\n : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions)\n}\n","import type {\n CompatibleError,\n CreateMutationOptions,\n MutationHook,\n} from './types'\nimport { ReactQuery, withMiddleware } from './utils'\n\nexport const createMutation = <\n TData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n defaultOptions: CreateMutationOptions<TData, TVariables, TError, TContext>\n): MutationHook<TData, TVariables, TError, TContext> => {\n return Object.assign(\n withMiddleware(ReactQuery.useMutation, defaultOptions, 'mutations'),\n {\n getKey: () => defaultOptions.mutationKey,\n getOptions: () => defaultOptions,\n mutationFn: defaultOptions.mutationFn,\n }\n ) as MutationHook<TData, TVariables, TError, TContext>\n}\n","import { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\nconst buildRouter = (keys: string[], config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!opts._type) {\n acc[key] = buildRouter([...keys, key], opts)\n } else {\n const options: any = {\n ...opts,\n [opts._type === `m` ? `mutationKey` : `queryKey`]: [...keys, key],\n }\n\n acc[key] =\n opts._type === `m`\n ? {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n : opts._type === `q`\n ? {\n useQuery: createQuery(options),\n useSuspenseQuery: createSuspenseQuery(options),\n ...createQuery(options),\n }\n : {\n useInfiniteQuery: createInfiniteQuery(options),\n useSuspenseInfiniteQuery: createSuspenseInfiniteQuery(options),\n ...createInfiniteQuery(options),\n }\n }\n\n return acc\n },\n {\n getKey: () => keys,\n } as any\n )\n}\n\nexport const router = <TConfig extends RouterConfig>(\n key: string,\n config: TConfig\n): CreateRouter<TConfig> => {\n return buildRouter([key], config)\n}\n\nrouter.query = <TFnData, TVariables = void, TError = CompatibleError>(\n options: RouterQueryOptions<TFnData, TVariables, TError>\n) => {\n return {\n ...options,\n _type: 'q',\n } as RouterQuery<TFnData, TVariables, TError>\n}\n\nrouter.infiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: RouterInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n) => {\n return { ...options, _type: 'inf' } as RouterInfiniteQuery<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n}\n\nrouter.mutation = <\n TFnData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n options: RouterMutationOptions<TFnData, TVariables, TError, TContext>\n) => {\n return { ...options, _type: 'm' } as RouterMutation<\n TFnData,\n TVariables,\n TError,\n TContext\n >\n}\n"],"names":["ReactQuery","TanstackReactQuery","isV5","useSuspenseQuery","suspenseOptions","enabled","suspense","useErrorBoundary","_error","query","state","data","withMiddleware","hook","defaultOptions","type","useMiddleware","options","queryClient","uses","opts","useQueryClient","getDefaultOptions","reduce","u1","o1","use","u2","o2","composedHook","reduceRight","next","getKey","queryKey","variables","createBaseQuery","useRQHook","overrideOptions","useDefaultOptions","console","error","queryFn","fetcher","queryKeyHashFn","getPreviousPageParam","getNextPageParam","initialPageParam","getQueryOptions","fetcherFn","context","getFullKey","getOptions","getFetchOptions","useBaseHook","Object","assign","createQuery","useQuery","createSuspenseQuery","createInfiniteQuery","useInfiniteQuery","createSuspenseInfiniteQuery","useSuspenseInfiniteQuery","createMutation","useMutation","mutationKey","mutationFn","buildRouter","keys","config","entries","acc","key","_type","router","infiniteQuery","mutation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAKO,MAAMA,UAAU,GAAGC,6BAAnB,CAAA;EAEA,MAAMC,IAAI,GAAG,CAAC,CAACF,UAAU,CAACG,gBAA1B,CAAA;EAEA,MAAMC,eAAe,GAAG;EAC7BC,EAAAA,OAAO,EAAE,IADoB;EAE7BC,EAAAA,QAAQ,EAAE,IAFmB;EAG7BC,EAAAA,gBAAgB,EAAE,CAACC,MAAD,EAAkBC,KAAlB,KAChB,OAAOA,KAAK,CAACC,KAAN,CAAYC,IAAnB,KAA4B,WAAA;EAJD,CAAxB,CAAA;EAOA,MAAMC,cAAc,GAAG,CAC5BC,IAD4B,EAE5BC,cAF4B,EAG5BC,IAH4B,KAIzB;EACH,EAAA,OAAO,SAASC,aAAT,CACLC,OADK,EAELC,WAFK,EAGL;MACA,MAAM,CAACC,IAAD,EAAOC,IAAP,IAAoC,CACxCpB,UAAU,CAACqB,cAAX;MAEEnB,IAAI,GAAGgB,WAAH,GAAiBD,OAFvB,EAGEK,iBAHF,EAAA,CAGsBP,IAHtB,CADwC,EAKxCD,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EACL,GAAGA,OADE;EAELwD,IAAAA,KAAK,EAAE,GAAA;KAFT,CAAA;EAID,CAPD,CAAA;;EASAC,MAAM,CAACC,aAAP,GAME1D,OANqB,IAOlB;IACH,OAAO,EAAE,GAAGA,OAAL;EAAcwD,IAAAA,KAAK,EAAE,KAAA;KAA5B,CAAA;EAMD,CAdD,CAAA;;EAgBAC,MAAM,CAACE,QAAP,GAME3D,OANgB,IAOb;IACH,OAAO,EAAE,GAAGA,OAAL;EAAcwD,IAAAA,KAAK,EAAE,GAAA;KAA5B,CAAA;EAMD,CAdD;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tanstack/react-query")):"function"==typeof define&&define.amd?define(["exports","@tanstack/react-query"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactQueryKit={},e.ReactQuery)}(this,(function(e,t){"use strict";function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(u){if("default"!==u){var r=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(t,u,r.get?r:{enumerable:!0,get:function(){return e[u]}})}})),t.default=e,Object.freeze(t)}const r=u(t),n=!!r.useSuspenseQuery,i={enabled:!0,suspense:!0,useErrorBoundary:(e,t)=>void 0===t.state.data},s=(e,t,u)=>function(i,s){const[a,y]=[r.useQueryClient(n?s:i).getDefaultOptions()[u],t,i].reduce((([e,t],{use:u=[],...r}={})=>[[...e,...u],{...t,...r}]),[[]]);return a.reduceRight(((e,t)=>t(e)),e)(y,s)},a=(e,t)=>void 0===t?
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tanstack/react-query")):"function"==typeof define&&define.amd?define(["exports","@tanstack/react-query"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactQueryKit={},e.ReactQuery)}(this,(function(e,t){"use strict";function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(u){if("default"!==u){var r=Object.getOwnPropertyDescriptor(e,u);Object.defineProperty(t,u,r.get?r:{enumerable:!0,get:function(){return e[u]}})}})),t.default=e,Object.freeze(t)}const r=u(t),n=!!r.useSuspenseQuery,i={enabled:!0,suspense:!0,useErrorBoundary:(e,t)=>void 0===t.state.data},s=(e,t,u)=>function(i,s){const[a,y]=[r.useQueryClient(n?s:i).getDefaultOptions()[u],t,i].reduce((([e,t],{use:u=[],...r}={})=>[[...e,...u],{...t,...r}]),[[]]);return a.reduceRight(((e,t)=>t(e)),e)(y,s)},a=(e,t)=>void 0===t?e:[...e,t],y=(e,t,u)=>{const{queryKey:r,fetcher:n,queryKeyHashFn:i,getPreviousPageParam:y,getNextPageParam:o,initialPageParam:c}=e,f=(e,t)=>({queryFn:u=>e(t,u),queryKey:a(r,t)});return Object.assign(s(((e,r)=>t({...e,...u,...f(e.fetcher,e.variables)},r)),e,"queries"),{fetcher:n,getKey:e=>a(r,e),getOptions:t=>({...e,...f(n,t)}),getFetchOptions:e=>({queryKeyHashFn:i,getPreviousPageParam:y,getNextPageParam:o,initialPageParam:c,...f(n,e)})})},o=e=>y(e,r.useQuery),c=e=>n?y(e,r.useSuspenseQuery):y(e,r.useQuery,i),f=e=>y(e,r.useInfiniteQuery),p=e=>n?y(e,r.useSuspenseInfiniteQuery):y(e,r.useInfiniteQuery,i),g=e=>Object.assign(s(r.useMutation,e,"mutations"),{getKey:()=>e.mutationKey,getOptions:()=>e,mutationFn:e.mutationFn}),d=(e,t)=>Object.entries(t).reduce(((t,[u,r])=>{if(r._type){const n={...r,["m"===r._type?"mutationKey":"queryKey"]:[...e,u]};t[u]="m"===r._type?{useMutation:g(n),...g(n)}:"q"===r._type?{useQuery:o(n),useSuspenseQuery:c(n),...o(n)}:{useInfiniteQuery:f(n),useSuspenseInfiniteQuery:p(n),...f(n)}}else t[u]=d([...e,u],r);return t}),{getKey:()=>e}),l=(e,t)=>d([e],t);l.query=e=>({...e,_type:"q"}),l.infiniteQuery=e=>({...e,_type:"inf"}),l.mutation=e=>({...e,_type:"m"}),e.createInfiniteQuery=f,e.createMutation=g,e.createQuery=o,e.createSuspenseInfiniteQuery=p,e.createSuspenseQuery=c,e.getKey=a,e.router=l,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=index.production.js.map
|