@pyreon/query 0.0.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/LICENSE +21 -0
- package/README.md +236 -0
- package/lib/analysis/index.js.html +5406 -0
- package/lib/index.js +489 -0
- package/lib/index.js.map +1 -0
- package/lib/types/index.d.ts +497 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index2.d.ts +298 -0
- package/lib/types/index2.d.ts.map +1 -0
- package/package.json +55 -0
- package/src/index.ts +69 -0
- package/src/query-client.ts +59 -0
- package/src/tests/query.test.ts +1768 -0
- package/src/use-infinite-query.ts +138 -0
- package/src/use-is-fetching.ts +44 -0
- package/src/use-mutation.ts +117 -0
- package/src/use-queries.ts +61 -0
- package/src/use-query-error-reset-boundary.ts +95 -0
- package/src/use-query.ts +106 -0
- package/src/use-suspense-query.ts +282 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { CancelledError, InfiniteQueryObserver, MutationCache, MutationObserver, QueriesObserver, QueryCache, QueryClient, QueryObserver, defaultShouldDehydrateMutation, defaultShouldDehydrateQuery, dehydrate, hashKey, hydrate, isCancelledError, keepPreviousData } from "@tanstack/query-core";
|
|
2
|
+
import { createContext, onMount, onUnmount, popContext, pushContext, useContext } from "@pyreon/core";
|
|
3
|
+
import { batch, effect, signal } from "@pyreon/reactivity";
|
|
4
|
+
|
|
5
|
+
//#region src/query-client.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Provides a QueryClient to all descendant components via context.
|
|
9
|
+
* Wrap your app root with this to enable useQuery / useMutation throughout the tree.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const client = new QueryClient()
|
|
13
|
+
* mount(h(QueryClientProvider, { client }, h(App, null)), el)
|
|
14
|
+
*/
|
|
15
|
+
function QueryClientProvider(props) {
|
|
16
|
+
pushContext(new Map([[QueryClientContext.id, props.client]]));
|
|
17
|
+
onMount(() => {
|
|
18
|
+
props.client.mount();
|
|
19
|
+
return () => props.client.unmount();
|
|
20
|
+
});
|
|
21
|
+
onUnmount(() => popContext());
|
|
22
|
+
const ch = props.children;
|
|
23
|
+
return typeof ch === "function" ? ch() : ch;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the nearest QueryClient provided by <QueryClientProvider>.
|
|
27
|
+
* Throws if called outside of one.
|
|
28
|
+
*/
|
|
29
|
+
function useQueryClient() {
|
|
30
|
+
const client = useContext(QueryClientContext);
|
|
31
|
+
if (!client) throw new Error("[pyreon/query] No QueryClient found. Wrap your app with <QueryClientProvider client={client}>.");
|
|
32
|
+
return client;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/use-query.ts
|
|
37
|
+
/**
|
|
38
|
+
* Subscribe to a query. Returns fine-grained reactive signals for data,
|
|
39
|
+
* error and status — each signal only notifies effects that depend on it.
|
|
40
|
+
*
|
|
41
|
+
* `options` is a function so it can read Pyreon signals — when a signal changes
|
|
42
|
+
* (e.g. a reactive query key), the observer is updated and refetches automatically.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* const userId = signal(1)
|
|
46
|
+
* const query = useQuery(() => ({
|
|
47
|
+
* queryKey: ['user', userId()],
|
|
48
|
+
* queryFn: () => fetch(`/api/users/${userId()}`).then(r => r.json()),
|
|
49
|
+
* }))
|
|
50
|
+
* // In template: () => query.data()?.name
|
|
51
|
+
*/
|
|
52
|
+
function useQuery(options) {
|
|
53
|
+
const observer = new QueryObserver(useQueryClient(), options());
|
|
54
|
+
const initial = observer.getCurrentResult();
|
|
55
|
+
const resultSig = signal(initial);
|
|
56
|
+
const dataSig = signal(initial.data);
|
|
57
|
+
const errorSig = signal(initial.error ?? null);
|
|
58
|
+
const statusSig = signal(initial.status);
|
|
59
|
+
const isPending = signal(initial.isPending);
|
|
60
|
+
const isLoading = signal(initial.isLoading);
|
|
61
|
+
const isFetching = signal(initial.isFetching);
|
|
62
|
+
const isError = signal(initial.isError);
|
|
63
|
+
const isSuccess = signal(initial.isSuccess);
|
|
64
|
+
const unsub = observer.subscribe(r => {
|
|
65
|
+
batch(() => {
|
|
66
|
+
resultSig.set(r);
|
|
67
|
+
dataSig.set(r.data);
|
|
68
|
+
errorSig.set(r.error ?? null);
|
|
69
|
+
statusSig.set(r.status);
|
|
70
|
+
isPending.set(r.isPending);
|
|
71
|
+
isLoading.set(r.isLoading);
|
|
72
|
+
isFetching.set(r.isFetching);
|
|
73
|
+
isError.set(r.isError);
|
|
74
|
+
isSuccess.set(r.isSuccess);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
effect(() => {
|
|
78
|
+
observer.setOptions(options());
|
|
79
|
+
});
|
|
80
|
+
onUnmount(() => unsub());
|
|
81
|
+
return {
|
|
82
|
+
result: resultSig,
|
|
83
|
+
data: dataSig,
|
|
84
|
+
error: errorSig,
|
|
85
|
+
status: statusSig,
|
|
86
|
+
isPending,
|
|
87
|
+
isLoading,
|
|
88
|
+
isFetching,
|
|
89
|
+
isError,
|
|
90
|
+
isSuccess,
|
|
91
|
+
refetch: () => observer.refetch()
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/use-mutation.ts
|
|
97
|
+
/**
|
|
98
|
+
* Run a mutation (create / update / delete). Returns reactive signals for
|
|
99
|
+
* pending / success / error state plus `mutate` and `mutateAsync` functions.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* const mutation = useMutation({
|
|
103
|
+
* mutationFn: (data: CreatePostInput) =>
|
|
104
|
+
* fetch('/api/posts', { method: 'POST', body: JSON.stringify(data) }).then(r => r.json()),
|
|
105
|
+
* onSuccess: () => client.invalidateQueries({ queryKey: ['posts'] }),
|
|
106
|
+
* })
|
|
107
|
+
* // h('button', { onClick: () => mutation.mutate({ title: 'New' }) }, 'Create')
|
|
108
|
+
*/
|
|
109
|
+
function useMutation(options) {
|
|
110
|
+
const observer = new MutationObserver(useQueryClient(), options);
|
|
111
|
+
const initial = observer.getCurrentResult();
|
|
112
|
+
const resultSig = signal(initial);
|
|
113
|
+
const dataSig = signal(initial.data);
|
|
114
|
+
const errorSig = signal(initial.error ?? null);
|
|
115
|
+
const statusSig = signal(initial.status);
|
|
116
|
+
const isPending = signal(initial.isPending);
|
|
117
|
+
const isSuccess = signal(initial.isSuccess);
|
|
118
|
+
const isError = signal(initial.isError);
|
|
119
|
+
const isIdle = signal(initial.isIdle);
|
|
120
|
+
const unsub = observer.subscribe(r => {
|
|
121
|
+
batch(() => {
|
|
122
|
+
resultSig.set(r);
|
|
123
|
+
dataSig.set(r.data);
|
|
124
|
+
errorSig.set(r.error ?? null);
|
|
125
|
+
statusSig.set(r.status);
|
|
126
|
+
isPending.set(r.isPending);
|
|
127
|
+
isSuccess.set(r.isSuccess);
|
|
128
|
+
isError.set(r.isError);
|
|
129
|
+
isIdle.set(r.isIdle);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
onUnmount(() => unsub());
|
|
133
|
+
return {
|
|
134
|
+
result: resultSig,
|
|
135
|
+
data: dataSig,
|
|
136
|
+
error: errorSig,
|
|
137
|
+
status: statusSig,
|
|
138
|
+
isPending,
|
|
139
|
+
isSuccess,
|
|
140
|
+
isError,
|
|
141
|
+
isIdle,
|
|
142
|
+
mutate: (vars, callbackOptions) => {
|
|
143
|
+
observer.mutate(vars, callbackOptions).catch(() => {});
|
|
144
|
+
},
|
|
145
|
+
mutateAsync: (vars, callbackOptions) => observer.mutate(vars, callbackOptions),
|
|
146
|
+
reset: () => observer.reset()
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/use-infinite-query.ts
|
|
152
|
+
/**
|
|
153
|
+
* Subscribe to a paginated / infinite-scroll query.
|
|
154
|
+
* Returns fine-grained reactive signals plus `fetchNextPage`, `fetchPreviousPage`,
|
|
155
|
+
* `hasNextPage` and `hasPreviousPage`.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* const query = useInfiniteQuery(() => ({
|
|
159
|
+
* queryKey: ['posts'],
|
|
160
|
+
* queryFn: ({ pageParam }) => fetchPosts(pageParam as number),
|
|
161
|
+
* initialPageParam: 0,
|
|
162
|
+
* getNextPageParam: (lastPage) => lastPage.nextCursor,
|
|
163
|
+
* }))
|
|
164
|
+
* // query.data()?.pages — array of pages
|
|
165
|
+
* // h('button', { onClick: () => query.fetchNextPage() }, 'Load more')
|
|
166
|
+
*/
|
|
167
|
+
function useInfiniteQuery(options) {
|
|
168
|
+
const observer = new InfiniteQueryObserver(useQueryClient(), options());
|
|
169
|
+
const initial = observer.getCurrentResult();
|
|
170
|
+
const resultSig = signal(initial);
|
|
171
|
+
const dataSig = signal(initial.data);
|
|
172
|
+
const errorSig = signal(initial.error ?? null);
|
|
173
|
+
const statusSig = signal(initial.status);
|
|
174
|
+
const isPending = signal(initial.isPending);
|
|
175
|
+
const isLoading = signal(initial.isLoading);
|
|
176
|
+
const isFetching = signal(initial.isFetching);
|
|
177
|
+
const isFetchingNextPage = signal(initial.isFetchingNextPage);
|
|
178
|
+
const isFetchingPreviousPage = signal(initial.isFetchingPreviousPage);
|
|
179
|
+
const isError = signal(initial.isError);
|
|
180
|
+
const isSuccess = signal(initial.isSuccess);
|
|
181
|
+
const hasNextPage = signal(initial.hasNextPage);
|
|
182
|
+
const hasPreviousPage = signal(initial.hasPreviousPage);
|
|
183
|
+
const unsub = observer.subscribe(r => {
|
|
184
|
+
batch(() => {
|
|
185
|
+
resultSig.set(r);
|
|
186
|
+
dataSig.set(r.data);
|
|
187
|
+
errorSig.set(r.error ?? null);
|
|
188
|
+
statusSig.set(r.status);
|
|
189
|
+
isPending.set(r.isPending);
|
|
190
|
+
isLoading.set(r.isLoading);
|
|
191
|
+
isFetching.set(r.isFetching);
|
|
192
|
+
isFetchingNextPage.set(r.isFetchingNextPage);
|
|
193
|
+
isFetchingPreviousPage.set(r.isFetchingPreviousPage);
|
|
194
|
+
isError.set(r.isError);
|
|
195
|
+
isSuccess.set(r.isSuccess);
|
|
196
|
+
hasNextPage.set(r.hasNextPage);
|
|
197
|
+
hasPreviousPage.set(r.hasPreviousPage);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
effect(() => {
|
|
201
|
+
observer.setOptions(options());
|
|
202
|
+
});
|
|
203
|
+
onUnmount(() => unsub());
|
|
204
|
+
return {
|
|
205
|
+
result: resultSig,
|
|
206
|
+
data: dataSig,
|
|
207
|
+
error: errorSig,
|
|
208
|
+
status: statusSig,
|
|
209
|
+
isPending,
|
|
210
|
+
isLoading,
|
|
211
|
+
isFetching,
|
|
212
|
+
isFetchingNextPage,
|
|
213
|
+
isFetchingPreviousPage,
|
|
214
|
+
isError,
|
|
215
|
+
isSuccess,
|
|
216
|
+
hasNextPage,
|
|
217
|
+
hasPreviousPage,
|
|
218
|
+
fetchNextPage: () => observer.fetchNextPage(),
|
|
219
|
+
fetchPreviousPage: () => observer.fetchPreviousPage(),
|
|
220
|
+
refetch: () => observer.refetch()
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/use-is-fetching.ts
|
|
226
|
+
/**
|
|
227
|
+
* Returns a signal that tracks how many queries are currently in-flight.
|
|
228
|
+
* Useful for global loading indicators.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* const fetching = useIsFetching()
|
|
232
|
+
* // h('span', null, () => fetching() > 0 ? 'Loading…' : '')
|
|
233
|
+
*/
|
|
234
|
+
function useIsFetching(filters) {
|
|
235
|
+
const client = useQueryClient();
|
|
236
|
+
const count = signal(client.isFetching(filters));
|
|
237
|
+
const unsub = client.getQueryCache().subscribe(() => {
|
|
238
|
+
count.set(client.isFetching(filters));
|
|
239
|
+
});
|
|
240
|
+
onUnmount(() => unsub());
|
|
241
|
+
return count;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Returns a signal that tracks how many mutations are currently in-flight.
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* const mutating = useIsMutating()
|
|
248
|
+
* // h('span', null, () => mutating() > 0 ? 'Saving…' : '')
|
|
249
|
+
*/
|
|
250
|
+
function useIsMutating(filters) {
|
|
251
|
+
const client = useQueryClient();
|
|
252
|
+
const count = signal(client.isMutating(filters));
|
|
253
|
+
const unsub = client.getMutationCache().subscribe(() => {
|
|
254
|
+
count.set(client.isMutating(filters));
|
|
255
|
+
});
|
|
256
|
+
onUnmount(() => unsub());
|
|
257
|
+
return count;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/use-queries.ts
|
|
262
|
+
/**
|
|
263
|
+
* Subscribe to multiple queries in parallel. Returns a single signal containing
|
|
264
|
+
* the array of results — index-aligned with the `queries` array.
|
|
265
|
+
*
|
|
266
|
+
* `queries` is a reactive function so signal-based keys trigger re-evaluation
|
|
267
|
+
* automatically.
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* const userIds = signal([1, 2, 3])
|
|
271
|
+
* const results = useQueries(() =>
|
|
272
|
+
* userIds().map(id => ({
|
|
273
|
+
* queryKey: ['user', id],
|
|
274
|
+
* queryFn: () => fetchUser(id),
|
|
275
|
+
* }))
|
|
276
|
+
* )
|
|
277
|
+
* // results() — QueryObserverResult[]
|
|
278
|
+
* // results()[0].data — first user
|
|
279
|
+
*/
|
|
280
|
+
function useQueries(queries) {
|
|
281
|
+
const observer = new QueriesObserver(useQueryClient(), queries());
|
|
282
|
+
const resultSig = signal(observer.getCurrentResult());
|
|
283
|
+
const unsub = observer.subscribe(results => {
|
|
284
|
+
resultSig.set(results);
|
|
285
|
+
});
|
|
286
|
+
effect(() => {
|
|
287
|
+
observer.setQueries(queries());
|
|
288
|
+
});
|
|
289
|
+
onUnmount(() => {
|
|
290
|
+
unsub();
|
|
291
|
+
observer.destroy();
|
|
292
|
+
});
|
|
293
|
+
return resultSig;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/use-suspense-query.ts
|
|
298
|
+
/**
|
|
299
|
+
* Pyreon-native Suspense boundary for queries. Shows `fallback` while any query
|
|
300
|
+
* is pending. On error, renders the `error` fallback or re-throws to the
|
|
301
|
+
* nearest Pyreon `ErrorBoundary`.
|
|
302
|
+
*
|
|
303
|
+
* Pair with `useSuspenseQuery` / `useSuspenseInfiniteQuery` to get non-undefined
|
|
304
|
+
* `data` types inside children.
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* const userQuery = useSuspenseQuery(() => ({ queryKey: ['user'], queryFn: fetchUser }))
|
|
308
|
+
*
|
|
309
|
+
* h(QuerySuspense, {
|
|
310
|
+
* query: userQuery,
|
|
311
|
+
* fallback: h(Spinner, null),
|
|
312
|
+
* error: (err) => h('p', null, `Failed: ${err}`),
|
|
313
|
+
* }, () => h(UserProfile, { user: userQuery.data() }))
|
|
314
|
+
*/
|
|
315
|
+
function QuerySuspense(props) {
|
|
316
|
+
return () => {
|
|
317
|
+
const queries = Array.isArray(props.query) ? props.query : [props.query];
|
|
318
|
+
for (const q of queries) if (q.isError()) {
|
|
319
|
+
const err = q.error();
|
|
320
|
+
if (props.error) return props.error(err);
|
|
321
|
+
throw err;
|
|
322
|
+
}
|
|
323
|
+
if (queries.some(q => q.isPending())) {
|
|
324
|
+
const fb = props.fallback;
|
|
325
|
+
return typeof fb === "function" ? fb() : fb ?? null;
|
|
326
|
+
}
|
|
327
|
+
const ch = props.children;
|
|
328
|
+
return typeof ch === "function" ? ch() : ch;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Like `useQuery` but `data` is typed as `Signal<TData>` (never undefined).
|
|
333
|
+
* Designed for use inside a `QuerySuspense` boundary, which guarantees
|
|
334
|
+
* children only render after the query succeeds.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* const user = useSuspenseQuery(() => ({ queryKey: ['user', id()], queryFn: fetchUser }))
|
|
338
|
+
*
|
|
339
|
+
* h(QuerySuspense, { query: user, fallback: h(Spinner, null) },
|
|
340
|
+
* () => h(UserCard, { name: user.data().name }),
|
|
341
|
+
* )
|
|
342
|
+
*/
|
|
343
|
+
function useSuspenseQuery(options) {
|
|
344
|
+
const observer = new QueryObserver(useQueryClient(), options());
|
|
345
|
+
const initial = observer.getCurrentResult();
|
|
346
|
+
const resultSig = signal(initial);
|
|
347
|
+
const dataSig = signal(initial.data);
|
|
348
|
+
const errorSig = signal(initial.error ?? null);
|
|
349
|
+
const statusSig = signal(initial.status);
|
|
350
|
+
const isPending = signal(initial.isPending);
|
|
351
|
+
const isFetching = signal(initial.isFetching);
|
|
352
|
+
const isError = signal(initial.isError);
|
|
353
|
+
const isSuccess = signal(initial.isSuccess);
|
|
354
|
+
const unsub = observer.subscribe(r => {
|
|
355
|
+
batch(() => {
|
|
356
|
+
resultSig.set(r);
|
|
357
|
+
if (r.data !== void 0) dataSig.set(r.data);
|
|
358
|
+
errorSig.set(r.error ?? null);
|
|
359
|
+
statusSig.set(r.status);
|
|
360
|
+
isPending.set(r.isPending);
|
|
361
|
+
isFetching.set(r.isFetching);
|
|
362
|
+
isError.set(r.isError);
|
|
363
|
+
isSuccess.set(r.isSuccess);
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
effect(() => {
|
|
367
|
+
observer.setOptions(options());
|
|
368
|
+
});
|
|
369
|
+
onUnmount(() => unsub());
|
|
370
|
+
return {
|
|
371
|
+
result: resultSig,
|
|
372
|
+
data: dataSig,
|
|
373
|
+
error: errorSig,
|
|
374
|
+
status: statusSig,
|
|
375
|
+
isPending,
|
|
376
|
+
isFetching,
|
|
377
|
+
isError,
|
|
378
|
+
isSuccess,
|
|
379
|
+
refetch: () => observer.refetch()
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Like `useInfiniteQuery` but `data` is typed as `Signal<InfiniteData<TData>>`
|
|
384
|
+
* (never undefined). Use inside a `QuerySuspense` boundary.
|
|
385
|
+
*/
|
|
386
|
+
function useSuspenseInfiniteQuery(options) {
|
|
387
|
+
const observer = new InfiniteQueryObserver(useQueryClient(), options());
|
|
388
|
+
const initial = observer.getCurrentResult();
|
|
389
|
+
const resultSig = signal(initial);
|
|
390
|
+
const dataSig = signal(initial.data);
|
|
391
|
+
const errorSig = signal(initial.error ?? null);
|
|
392
|
+
const statusSig = signal(initial.status);
|
|
393
|
+
const isFetching = signal(initial.isFetching);
|
|
394
|
+
const isFetchingNextPage = signal(initial.isFetchingNextPage);
|
|
395
|
+
const isFetchingPreviousPage = signal(initial.isFetchingPreviousPage);
|
|
396
|
+
const isError = signal(initial.isError);
|
|
397
|
+
const isSuccess = signal(initial.isSuccess);
|
|
398
|
+
const hasNextPage = signal(initial.hasNextPage);
|
|
399
|
+
const hasPreviousPage = signal(initial.hasPreviousPage);
|
|
400
|
+
const unsub = observer.subscribe(r => {
|
|
401
|
+
batch(() => {
|
|
402
|
+
resultSig.set(r);
|
|
403
|
+
if (r.data !== void 0) dataSig.set(r.data);
|
|
404
|
+
errorSig.set(r.error ?? null);
|
|
405
|
+
statusSig.set(r.status);
|
|
406
|
+
isFetching.set(r.isFetching);
|
|
407
|
+
isFetchingNextPage.set(r.isFetchingNextPage);
|
|
408
|
+
isFetchingPreviousPage.set(r.isFetchingPreviousPage);
|
|
409
|
+
isError.set(r.isError);
|
|
410
|
+
isSuccess.set(r.isSuccess);
|
|
411
|
+
hasNextPage.set(r.hasNextPage);
|
|
412
|
+
hasPreviousPage.set(r.hasPreviousPage);
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
effect(() => {
|
|
416
|
+
observer.setOptions(options());
|
|
417
|
+
});
|
|
418
|
+
onUnmount(() => unsub());
|
|
419
|
+
return {
|
|
420
|
+
result: resultSig,
|
|
421
|
+
data: dataSig,
|
|
422
|
+
error: errorSig,
|
|
423
|
+
status: statusSig,
|
|
424
|
+
isFetching,
|
|
425
|
+
isFetchingNextPage,
|
|
426
|
+
isFetchingPreviousPage,
|
|
427
|
+
isError,
|
|
428
|
+
isSuccess,
|
|
429
|
+
hasNextPage,
|
|
430
|
+
hasPreviousPage,
|
|
431
|
+
fetchNextPage: () => observer.fetchNextPage(),
|
|
432
|
+
fetchPreviousPage: () => observer.fetchPreviousPage(),
|
|
433
|
+
refetch: () => observer.refetch()
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/use-query-error-reset-boundary.ts
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Wraps a subtree so that `useQueryErrorResetBoundary()` descendants can reset
|
|
442
|
+
* all errored queries within this boundary.
|
|
443
|
+
*
|
|
444
|
+
* Pair with Pyreon's `ErrorBoundary` to retry failed queries when the user
|
|
445
|
+
* dismisses the error fallback:
|
|
446
|
+
*
|
|
447
|
+
* @example
|
|
448
|
+
* h(QueryErrorResetBoundary, null,
|
|
449
|
+
* h(ErrorBoundary, {
|
|
450
|
+
* fallback: (err, boundaryReset) => {
|
|
451
|
+
* const { reset } = useQueryErrorResetBoundary()
|
|
452
|
+
* return h('button', {
|
|
453
|
+
* onClick: () => { reset(); boundaryReset() },
|
|
454
|
+
* }, 'Retry')
|
|
455
|
+
* },
|
|
456
|
+
* }, h(MyComponent, null)),
|
|
457
|
+
* )
|
|
458
|
+
*/
|
|
459
|
+
function QueryErrorResetBoundary(props) {
|
|
460
|
+
const client = useQueryClient();
|
|
461
|
+
pushContext(new Map([[QueryErrorResetBoundaryContext.id, {
|
|
462
|
+
reset: () => {
|
|
463
|
+
client.refetchQueries({
|
|
464
|
+
predicate: query => query.state.status === "error"
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}]]));
|
|
468
|
+
onUnmount(() => popContext());
|
|
469
|
+
const ch = props.children;
|
|
470
|
+
return typeof ch === "function" ? ch() : ch;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Returns the `reset` function provided by the nearest `QueryErrorResetBoundary`.
|
|
474
|
+
* If called outside a boundary, falls back to resetting all errored queries
|
|
475
|
+
* on the current `QueryClient`.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* // Inside an ErrorBoundary fallback:
|
|
479
|
+
* const { reset } = useQueryErrorResetBoundary()
|
|
480
|
+
* h('button', { onClick: () => { reset(); boundaryReset() } }, 'Retry')
|
|
481
|
+
*/
|
|
482
|
+
function useQueryErrorResetBoundary() {
|
|
483
|
+
const boundary = useContext(QueryErrorResetBoundaryContext);
|
|
484
|
+
const client = useQueryClient();
|
|
485
|
+
if (boundary) return boundary;
|
|
486
|
+
return {
|
|
487
|
+
reset: () => {
|
|
488
|
+
client.refetchQueries({
|
|
489
|
+
predicate: query => query.state.status === "error"
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
//#endregion
|
|
496
|
+
export { CancelledError, MutationCache, QueryCache, QueryClient, QueryClientContext, QueryClientProvider, QueryErrorResetBoundary, QuerySuspense, defaultShouldDehydrateMutation, defaultShouldDehydrateQuery, dehydrate, hashKey, hydrate, isCancelledError, keepPreviousData, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useQueries, useQuery, useQueryClient, useQueryErrorResetBoundary, useSuspenseInfiniteQuery, useSuspenseQuery };
|
|
497
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/query-client.ts","../../src/use-query.ts","../../src/use-mutation.ts","../../src/use-infinite-query.ts","../../src/use-is-fetching.ts","../../src/use-queries.ts","../../src/use-suspense-query.ts","../../src/use-query-error-reset-boundary.ts"],"mappings":";;;;;;;;;;;;;;AA2BA,SAAgB,mBAAA,CAAoB,KAAA,EAAwC;EAI1E,WAAA,CADc,IAAI,GAAA,CAAI,CAAC,CAAC,kBAAA,CAAmB,EAAA,EA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