@tanstack/lit-query 0.2.11 → 0.2.13
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 +17 -0
- package/build/legacy/index.cjs +1585 -0
- package/build/legacy/index.cjs.map +1 -0
- package/build/legacy/index.d.cts +781 -0
- package/build/legacy/index.d.cts.map +1 -0
- package/build/legacy/index.d.ts +781 -0
- package/build/legacy/index.d.ts.map +1 -0
- package/build/legacy/index.js +1561 -0
- package/build/legacy/index.js.map +1 -0
- package/build/modern/index.cjs +1569 -0
- package/build/modern/index.cjs.map +1 -0
- package/build/modern/index.d.cts +781 -0
- package/build/modern/index.d.cts.map +1 -0
- package/build/modern/index.d.ts +781 -0
- package/build/modern/index.d.ts.map +1 -0
- package/build/modern/index.js +1545 -0
- package/build/modern/index.js.map +1 -0
- package/package.json +27 -30
- package/src/createInfiniteQueryController.ts +0 -1
- package/src/createMutationController.ts +9 -7
- package/src/createQueriesController.ts +0 -2
- package/src/createQueryController.ts +0 -1
- package/src/infiniteQueryOptions.ts +10 -4
- package/dist/QueryClientProvider.d.ts +0 -85
- package/dist/QueryClientProvider.d.ts.map +0 -1
- package/dist/QueryClientProvider.js +0 -137
- package/dist/QueryClientProvider.js.map +0 -1
- package/dist/accessor.d.ts +0 -32
- package/dist/accessor.d.ts.map +0 -1
- package/dist/accessor.js +0 -12
- package/dist/accessor.js.map +0 -1
- package/dist/context.d.ts +0 -59
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -100
- package/dist/context.js.map +0 -1
- package/dist/controllers/BaseController.d.ts +0 -39
- package/dist/controllers/BaseController.d.ts.map +0 -1
- package/dist/controllers/BaseController.js +0 -213
- package/dist/controllers/BaseController.js.map +0 -1
- package/dist/createInfiniteQueryController.d.ts +0 -76
- package/dist/createInfiniteQueryController.d.ts.map +0 -1
- package/dist/createInfiniteQueryController.js +0 -248
- package/dist/createInfiniteQueryController.js.map +0 -1
- package/dist/createMutationController.d.ts +0 -79
- package/dist/createMutationController.d.ts.map +0 -1
- package/dist/createMutationController.js +0 -193
- package/dist/createMutationController.js.map +0 -1
- package/dist/createQueriesController.d.ts +0 -145
- package/dist/createQueriesController.d.ts.map +0 -1
- package/dist/createQueriesController.js +0 -367
- package/dist/createQueriesController.js.map +0 -1
- package/dist/createQueryController.d.ts +0 -67
- package/dist/createQueryController.d.ts.map +0 -1
- package/dist/createQueryController.js +0 -238
- package/dist/createQueryController.js.map +0 -1
- package/dist/index.d.ts +0 -24
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +0 -1
- package/dist/infiniteQueryOptions.d.ts +0 -21
- package/dist/infiniteQueryOptions.d.ts.map +0 -1
- package/dist/infiniteQueryOptions.js +0 -22
- package/dist/infiniteQueryOptions.js.map +0 -1
- package/dist/mutationOptions.d.ts +0 -19
- package/dist/mutationOptions.d.ts.map +0 -1
- package/dist/mutationOptions.js +0 -20
- package/dist/mutationOptions.js.map +0 -1
- package/dist/queryObserverResultTracker.d.ts +0 -14
- package/dist/queryObserverResultTracker.d.ts.map +0 -1
- package/dist/queryObserverResultTracker.js +0 -18
- package/dist/queryObserverResultTracker.js.map +0 -1
- package/dist/queryOptions.d.ts +0 -62
- package/dist/queryOptions.d.ts.map +0 -1
- package/dist/queryOptions.js +0 -4
- package/dist/queryOptions.js.map +0 -1
- package/dist/types.d.ts +0 -31
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/useIsFetching.d.ts +0 -45
- package/dist/useIsFetching.d.ts.map +0 -1
- package/dist/useIsFetching.js +0 -116
- package/dist/useIsFetching.js.map +0 -1
- package/dist/useIsMutating.d.ts +0 -45
- package/dist/useIsMutating.d.ts.map +0 -1
- package/dist/useIsMutating.js +0 -116
- package/dist/useIsMutating.js.map +0 -1
- package/dist/useMutationState.d.ts +0 -57
- package/dist/useMutationState.d.ts.map +0 -1
- package/dist/useMutationState.js +0 -136
- package/dist/useMutationState.js.map +0 -1
- package/dist-cjs/QueryClientProvider.d.cts +0 -84
- package/dist-cjs/QueryClientProvider.js +0 -141
- package/dist-cjs/QueryClientProvider.js.map +0 -1
- package/dist-cjs/accessor.d.cts +0 -31
- package/dist-cjs/accessor.js +0 -16
- package/dist-cjs/accessor.js.map +0 -1
- package/dist-cjs/context.d.cts +0 -58
- package/dist-cjs/context.js +0 -109
- package/dist-cjs/context.js.map +0 -1
- package/dist-cjs/controllers/BaseController.d.cts +0 -38
- package/dist-cjs/controllers/BaseController.js +0 -217
- package/dist-cjs/controllers/BaseController.js.map +0 -1
- package/dist-cjs/createInfiniteQueryController.d.cts +0 -75
- package/dist-cjs/createInfiniteQueryController.js +0 -251
- package/dist-cjs/createInfiniteQueryController.js.map +0 -1
- package/dist-cjs/createMutationController.d.cts +0 -78
- package/dist-cjs/createMutationController.js +0 -196
- package/dist-cjs/createMutationController.js.map +0 -1
- package/dist-cjs/createQueriesController.d.cts +0 -144
- package/dist-cjs/createQueriesController.js +0 -370
- package/dist-cjs/createQueriesController.js.map +0 -1
- package/dist-cjs/createQueryController.d.cts +0 -66
- package/dist-cjs/createQueryController.js +0 -241
- package/dist-cjs/createQueryController.js.map +0 -1
- package/dist-cjs/index.d.cts +0 -23
- package/dist-cjs/index.js +0 -49
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/infiniteQueryOptions.d.cts +0 -20
- package/dist-cjs/infiniteQueryOptions.js +0 -25
- package/dist-cjs/infiniteQueryOptions.js.map +0 -1
- package/dist-cjs/mutationOptions.d.cts +0 -18
- package/dist-cjs/mutationOptions.js +0 -23
- package/dist-cjs/mutationOptions.js.map +0 -1
- package/dist-cjs/package.json +0 -3
- package/dist-cjs/queryObserverResultTracker.d.cts +0 -13
- package/dist-cjs/queryObserverResultTracker.js +0 -22
- package/dist-cjs/queryObserverResultTracker.js.map +0 -1
- package/dist-cjs/queryOptions.d.cts +0 -61
- package/dist-cjs/queryOptions.js +0 -7
- package/dist-cjs/queryOptions.js.map +0 -1
- package/dist-cjs/types.d.cts +0 -30
- package/dist-cjs/types.js +0 -3
- package/dist-cjs/types.js.map +0 -1
- package/dist-cjs/useIsFetching.d.cts +0 -44
- package/dist-cjs/useIsFetching.js +0 -119
- package/dist-cjs/useIsFetching.js.map +0 -1
- package/dist-cjs/useIsMutating.d.cts +0 -44
- package/dist-cjs/useIsMutating.js +0 -119
- package/dist-cjs/useIsMutating.js.map +0 -1
- package/dist-cjs/useMutationState.d.cts +0 -56
- package/dist-cjs/useMutationState.js +0 -139
- package/dist-cjs/useMutationState.js.map +0 -1
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useIsFetching = useIsFetching;
|
|
4
|
-
const accessor_js_1 = require("./accessor.js");
|
|
5
|
-
const BaseController_js_1 = require("./controllers/BaseController.js");
|
|
6
|
-
class IsFetchingController extends BaseController_js_1.BaseController {
|
|
7
|
-
filters;
|
|
8
|
-
queryClient;
|
|
9
|
-
unsubscribe;
|
|
10
|
-
constructor(host, filters = {}, queryClient) {
|
|
11
|
-
super(host, 0, queryClient);
|
|
12
|
-
this.filters = filters;
|
|
13
|
-
if (!queryClient) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
this.queryClient = queryClient;
|
|
17
|
-
this.result = this.computeValue();
|
|
18
|
-
}
|
|
19
|
-
onConnected() {
|
|
20
|
-
if (!this.syncClient()) {
|
|
21
|
-
this.setResult(0);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
this.subscribe();
|
|
25
|
-
this.setResult(this.computeValue());
|
|
26
|
-
}
|
|
27
|
-
onDisconnected() {
|
|
28
|
-
this.unsubscribe?.();
|
|
29
|
-
this.unsubscribe = undefined;
|
|
30
|
-
this.syncClient();
|
|
31
|
-
}
|
|
32
|
-
onHostUpdate() {
|
|
33
|
-
if (typeof this.filters !== 'function') {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
this.setResult(this.syncClient() ? this.computeValue() : 0);
|
|
37
|
-
}
|
|
38
|
-
onQueryClientChanged() {
|
|
39
|
-
if (!this.syncClient()) {
|
|
40
|
-
this.setResult(0);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (this.connectedState) {
|
|
44
|
-
this.subscribe();
|
|
45
|
-
this.setResult(this.computeValue());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
syncClient() {
|
|
49
|
-
const nextClient = this.tryGetQueryClient();
|
|
50
|
-
if (!nextClient) {
|
|
51
|
-
this.unsubscribe?.();
|
|
52
|
-
this.unsubscribe = undefined;
|
|
53
|
-
this.queryClient = undefined;
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
if (nextClient === this.queryClient) {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
this.unsubscribe?.();
|
|
60
|
-
this.unsubscribe = undefined;
|
|
61
|
-
this.queryClient = nextClient;
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
subscribe() {
|
|
65
|
-
if (!this.queryClient) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (this.unsubscribe) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
this.unsubscribe = this.queryClient.getQueryCache().subscribe(() => {
|
|
72
|
-
this.setResult(this.computeValue());
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
computeValue() {
|
|
76
|
-
if (!this.queryClient) {
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
return this.queryClient.isFetching((0, accessor_js_1.readAccessor)(this.filters));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Creates a Lit reactive controller that tracks how many matching queries are
|
|
84
|
-
* currently fetching.
|
|
85
|
-
*
|
|
86
|
-
* When `filters` is a function, it is re-read during host updates so the count
|
|
87
|
-
* can follow reactive host state. If `queryClient` is omitted, the controller
|
|
88
|
-
* resolves the client from the nearest connected `QueryClientProvider`.
|
|
89
|
-
*
|
|
90
|
-
* @param host - The Lit reactive controller host that owns the cache
|
|
91
|
-
* subscription.
|
|
92
|
-
* @param filters - Query filters, or a getter that returns query filters.
|
|
93
|
-
* @param queryClient - Optional explicit query client. Provide this for
|
|
94
|
-
* controllers that should not resolve a client from Lit context.
|
|
95
|
-
* @returns An accessor for the current number of matching fetching queries.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* import { LitElement, html } from 'lit'
|
|
100
|
-
* import { useIsFetching } from '@tanstack/lit-query'
|
|
101
|
-
*
|
|
102
|
-
* class TodosStatus extends LitElement {
|
|
103
|
-
* private readonly todosFetching = useIsFetching(this, {
|
|
104
|
-
* queryKey: ['todos'],
|
|
105
|
-
* })
|
|
106
|
-
*
|
|
107
|
-
* render() {
|
|
108
|
-
* return html`<span>${this.todosFetching()} active todo fetches</span>`
|
|
109
|
-
* }
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
function useIsFetching(host, filters = {}, queryClient) {
|
|
114
|
-
const controller = new IsFetchingController(host, filters, queryClient);
|
|
115
|
-
return Object.assign((0, accessor_js_1.createValueAccessor)(() => controller.current), {
|
|
116
|
-
destroy: () => controller.destroy(),
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=useIsFetching.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIsFetching.js","sourceRoot":"","sources":["../src/useIsFetching.ts"],"names":[],"mappings":";;AAkJA,sCAYC;AA5JD,+CAKsB;AACtB,uEAAgE;AAUhE,MAAM,oBAAqB,SAAQ,kCAAsB;IAMpC;IALX,WAAW,CAAyB;IACpC,WAAW,CAA0B;IAE7C,YACE,IAA4B,EACX,UAAkC,EAAE,EACrD,WAAyB;QAEzB,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,CAAA;QA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AmB,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAC7C;QACE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE;KACpC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { MutationFilters, QueryClient } from '@tanstack/query-core';
|
|
2
|
-
import type { ReactiveControllerHost } from 'lit' with { "resolution-mode": "import" };
|
|
3
|
-
import { type Accessor, type ValueAccessor } from './accessor.cjs';
|
|
4
|
-
/**
|
|
5
|
-
* Accessor returned by `useIsMutating`.
|
|
6
|
-
*
|
|
7
|
-
* Call the accessor or read its `current` property to get the number of
|
|
8
|
-
* currently pending mutations that match the filters.
|
|
9
|
-
*/
|
|
10
|
-
export type IsMutatingAccessor = ValueAccessor<number> & {
|
|
11
|
-
destroy: () => void;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Creates a Lit reactive controller that tracks how many matching mutations are
|
|
15
|
-
* currently pending.
|
|
16
|
-
*
|
|
17
|
-
* When `filters` is a function, it is re-read during host updates so the count
|
|
18
|
-
* can follow reactive host state. If `queryClient` is omitted, the controller
|
|
19
|
-
* resolves the client from the nearest connected `QueryClientProvider`.
|
|
20
|
-
*
|
|
21
|
-
* @param host - The Lit reactive controller host that owns the cache
|
|
22
|
-
* subscription.
|
|
23
|
-
* @param filters - Mutation filters, or a getter that returns mutation filters.
|
|
24
|
-
* @param queryClient - Optional explicit query client. Provide this for
|
|
25
|
-
* controllers that should not resolve a client from Lit context.
|
|
26
|
-
* @returns An accessor for the current number of matching pending mutations.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* import { LitElement, html } from 'lit'
|
|
31
|
-
* import { useIsMutating } from '@tanstack/lit-query'
|
|
32
|
-
*
|
|
33
|
-
* class MutationStatus extends LitElement {
|
|
34
|
-
* private readonly savesPending = useIsMutating(this, {
|
|
35
|
-
* mutationKey: ['save-project'],
|
|
36
|
-
* })
|
|
37
|
-
*
|
|
38
|
-
* render() {
|
|
39
|
-
* return html`<span>${this.savesPending()} saves pending</span>`
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function useIsMutating(host: ReactiveControllerHost, filters?: Accessor<MutationFilters>, queryClient?: QueryClient): IsMutatingAccessor;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useIsMutating = useIsMutating;
|
|
4
|
-
const accessor_js_1 = require("./accessor.js");
|
|
5
|
-
const BaseController_js_1 = require("./controllers/BaseController.js");
|
|
6
|
-
class IsMutatingController extends BaseController_js_1.BaseController {
|
|
7
|
-
filters;
|
|
8
|
-
queryClient;
|
|
9
|
-
unsubscribe;
|
|
10
|
-
constructor(host, filters = {}, queryClient) {
|
|
11
|
-
super(host, 0, queryClient);
|
|
12
|
-
this.filters = filters;
|
|
13
|
-
if (!queryClient) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
this.queryClient = queryClient;
|
|
17
|
-
this.result = this.computeValue();
|
|
18
|
-
}
|
|
19
|
-
onConnected() {
|
|
20
|
-
if (!this.syncClient()) {
|
|
21
|
-
this.setResult(0);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
this.subscribe();
|
|
25
|
-
this.setResult(this.computeValue());
|
|
26
|
-
}
|
|
27
|
-
onDisconnected() {
|
|
28
|
-
this.unsubscribe?.();
|
|
29
|
-
this.unsubscribe = undefined;
|
|
30
|
-
this.syncClient();
|
|
31
|
-
}
|
|
32
|
-
onHostUpdate() {
|
|
33
|
-
if (typeof this.filters !== 'function') {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
this.setResult(this.syncClient() ? this.computeValue() : 0);
|
|
37
|
-
}
|
|
38
|
-
onQueryClientChanged() {
|
|
39
|
-
if (!this.syncClient()) {
|
|
40
|
-
this.setResult(0);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (this.connectedState) {
|
|
44
|
-
this.subscribe();
|
|
45
|
-
this.setResult(this.computeValue());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
syncClient() {
|
|
49
|
-
const nextClient = this.tryGetQueryClient();
|
|
50
|
-
if (!nextClient) {
|
|
51
|
-
this.unsubscribe?.();
|
|
52
|
-
this.unsubscribe = undefined;
|
|
53
|
-
this.queryClient = undefined;
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
if (nextClient === this.queryClient) {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
this.unsubscribe?.();
|
|
60
|
-
this.unsubscribe = undefined;
|
|
61
|
-
this.queryClient = nextClient;
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
subscribe() {
|
|
65
|
-
if (!this.queryClient) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (this.unsubscribe) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
this.unsubscribe = this.queryClient.getMutationCache().subscribe(() => {
|
|
72
|
-
this.setResult(this.computeValue());
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
computeValue() {
|
|
76
|
-
if (!this.queryClient) {
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
return this.queryClient.isMutating((0, accessor_js_1.readAccessor)(this.filters));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Creates a Lit reactive controller that tracks how many matching mutations are
|
|
84
|
-
* currently pending.
|
|
85
|
-
*
|
|
86
|
-
* When `filters` is a function, it is re-read during host updates so the count
|
|
87
|
-
* can follow reactive host state. If `queryClient` is omitted, the controller
|
|
88
|
-
* resolves the client from the nearest connected `QueryClientProvider`.
|
|
89
|
-
*
|
|
90
|
-
* @param host - The Lit reactive controller host that owns the cache
|
|
91
|
-
* subscription.
|
|
92
|
-
* @param filters - Mutation filters, or a getter that returns mutation filters.
|
|
93
|
-
* @param queryClient - Optional explicit query client. Provide this for
|
|
94
|
-
* controllers that should not resolve a client from Lit context.
|
|
95
|
-
* @returns An accessor for the current number of matching pending mutations.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* import { LitElement, html } from 'lit'
|
|
100
|
-
* import { useIsMutating } from '@tanstack/lit-query'
|
|
101
|
-
*
|
|
102
|
-
* class MutationStatus extends LitElement {
|
|
103
|
-
* private readonly savesPending = useIsMutating(this, {
|
|
104
|
-
* mutationKey: ['save-project'],
|
|
105
|
-
* })
|
|
106
|
-
*
|
|
107
|
-
* render() {
|
|
108
|
-
* return html`<span>${this.savesPending()} saves pending</span>`
|
|
109
|
-
* }
|
|
110
|
-
* }
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
function useIsMutating(host, filters = {}, queryClient) {
|
|
114
|
-
const controller = new IsMutatingController(host, filters, queryClient);
|
|
115
|
-
return Object.assign((0, accessor_js_1.createValueAccessor)(() => controller.current), {
|
|
116
|
-
destroy: () => controller.destroy(),
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=useIsMutating.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIsMutating.js","sourceRoot":"","sources":["../src/useIsMutating.ts"],"names":[],"mappings":";;AAkJA,sCAYC;AA5JD,+CAKsB;AACtB,uEAAgE;AAUhE,MAAM,oBAAqB,SAAQ,kCAAsB;IAMpC;IALX,WAAW,CAAyB;IACpC,WAAW,CAA0B;IAE7C,YACE,IAA4B,EACX,UAAqC,EAAE,EACxD,WAAyB;QAEzB,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,CAAA;QAHV,YAAO,GAAP,OAAO,CAAgC;QAKxD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,WAA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OAAO,EAAE;KACpC,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { type Mutation, type MutationFilters, type MutationState, type QueryClient } from '@tanstack/query-core';
|
|
2
|
-
import type { ReactiveControllerHost } from 'lit' with { "resolution-mode": "import" };
|
|
3
|
-
import { type Accessor, type ValueAccessor } from './accessor.cjs';
|
|
4
|
-
/**
|
|
5
|
-
* Options accepted by `useMutationState`.
|
|
6
|
-
*/
|
|
7
|
-
export type MutationStateOptions<TResult> = {
|
|
8
|
-
/** Filters used to select mutations from the mutation cache. */
|
|
9
|
-
filters?: Accessor<MutationFilters>;
|
|
10
|
-
/** Maps each matching mutation to the value returned by the accessor. */
|
|
11
|
-
select?: (mutation: Mutation) => TResult;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Accessor returned by `useMutationState`.
|
|
15
|
-
*
|
|
16
|
-
* Call the accessor or read its `current` property to get the selected state for
|
|
17
|
-
* matching mutations.
|
|
18
|
-
*/
|
|
19
|
-
export type MutationStateAccessor<TResult> = ValueAccessor<TResult[]> & {
|
|
20
|
-
/** Removes the controller from its Lit host and unsubscribes observers. */
|
|
21
|
-
destroy: () => void;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Creates a Lit reactive controller that selects state from matching mutations
|
|
25
|
-
* in the mutation cache.
|
|
26
|
-
*
|
|
27
|
-
* When `options.filters` is a function, it is re-read during host updates so
|
|
28
|
-
* the selection can follow reactive host state. If `queryClient` is omitted,
|
|
29
|
-
* the controller resolves the client from the nearest connected
|
|
30
|
-
* `QueryClientProvider`.
|
|
31
|
-
*
|
|
32
|
-
* @param host - The Lit reactive controller host that owns the mutation cache
|
|
33
|
-
* subscription.
|
|
34
|
-
* @param options - Mutation state filters and optional selector.
|
|
35
|
-
* @param queryClient - Optional explicit query client. Provide this for
|
|
36
|
-
* controllers that should not resolve a client from Lit context.
|
|
37
|
-
* @returns An accessor for the selected mutation state array.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* import { LitElement, html } from 'lit'
|
|
42
|
-
* import { useMutationState } from '@tanstack/lit-query'
|
|
43
|
-
*
|
|
44
|
-
* class PendingUploads extends LitElement {
|
|
45
|
-
* private readonly uploads = useMutationState(this, {
|
|
46
|
-
* filters: { mutationKey: ['upload'], status: 'pending' },
|
|
47
|
-
* select: (mutation) => mutation.state.variables as File,
|
|
48
|
-
* })
|
|
49
|
-
*
|
|
50
|
-
* render() {
|
|
51
|
-
* return html`<span>${this.uploads().length} uploads pending</span>`
|
|
52
|
-
* }
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
export declare function useMutationState<TResult = MutationState<unknown, unknown, unknown, unknown>>(host: ReactiveControllerHost, options?: MutationStateOptions<TResult>, queryClient?: QueryClient): MutationStateAccessor<TResult>;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMutationState = useMutationState;
|
|
4
|
-
const query_core_1 = require("@tanstack/query-core");
|
|
5
|
-
const accessor_js_1 = require("./accessor.js");
|
|
6
|
-
const BaseController_js_1 = require("./controllers/BaseController.js");
|
|
7
|
-
class MutationStateController extends BaseController_js_1.BaseController {
|
|
8
|
-
options;
|
|
9
|
-
queryClient;
|
|
10
|
-
unsubscribe;
|
|
11
|
-
constructor(host, options, queryClient) {
|
|
12
|
-
super(host, [], queryClient);
|
|
13
|
-
this.options = options;
|
|
14
|
-
if (!queryClient) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
this.queryClient = queryClient;
|
|
18
|
-
this.result = this.computeState();
|
|
19
|
-
}
|
|
20
|
-
onConnected() {
|
|
21
|
-
if (!this.syncClient()) {
|
|
22
|
-
this.setMutationState([]);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
this.subscribe();
|
|
26
|
-
this.setMutationState(this.computeState());
|
|
27
|
-
}
|
|
28
|
-
onDisconnected() {
|
|
29
|
-
this.unsubscribe?.();
|
|
30
|
-
this.unsubscribe = undefined;
|
|
31
|
-
this.syncClient();
|
|
32
|
-
}
|
|
33
|
-
onHostUpdate() {
|
|
34
|
-
if (!this.shouldRefreshOnHostUpdate()) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
this.setMutationState(this.syncClient() ? this.computeState() : []);
|
|
38
|
-
}
|
|
39
|
-
onQueryClientChanged() {
|
|
40
|
-
if (!this.syncClient()) {
|
|
41
|
-
this.setMutationState([]);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (this.connectedState) {
|
|
45
|
-
this.subscribe();
|
|
46
|
-
this.setMutationState(this.computeState());
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
syncClient() {
|
|
50
|
-
const nextClient = this.tryGetQueryClient();
|
|
51
|
-
if (!nextClient) {
|
|
52
|
-
this.unsubscribe?.();
|
|
53
|
-
this.unsubscribe = undefined;
|
|
54
|
-
this.queryClient = undefined;
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
if (nextClient === this.queryClient) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
this.unsubscribe?.();
|
|
61
|
-
this.unsubscribe = undefined;
|
|
62
|
-
this.queryClient = nextClient;
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
subscribe() {
|
|
66
|
-
if (!this.queryClient) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (this.unsubscribe) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
this.unsubscribe = this.queryClient.getMutationCache().subscribe(() => {
|
|
73
|
-
this.setMutationState(this.computeState());
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
setMutationState(next) {
|
|
77
|
-
this.setResult((0, query_core_1.replaceEqualDeep)(this.result, next));
|
|
78
|
-
}
|
|
79
|
-
shouldRefreshOnHostUpdate() {
|
|
80
|
-
return (typeof this.options.filters === 'function' ||
|
|
81
|
-
typeof this.options.select === 'function');
|
|
82
|
-
}
|
|
83
|
-
computeState() {
|
|
84
|
-
if (!this.queryClient) {
|
|
85
|
-
return [];
|
|
86
|
-
}
|
|
87
|
-
const filters = this.options.filters
|
|
88
|
-
? (0, accessor_js_1.readAccessor)(this.options.filters)
|
|
89
|
-
: undefined;
|
|
90
|
-
const select = this.options.select;
|
|
91
|
-
const mutations = this.queryClient.getMutationCache().findAll(filters);
|
|
92
|
-
return mutations.map((mutation) => {
|
|
93
|
-
if (select) {
|
|
94
|
-
return select(mutation);
|
|
95
|
-
}
|
|
96
|
-
return mutation.state;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Creates a Lit reactive controller that selects state from matching mutations
|
|
102
|
-
* in the mutation cache.
|
|
103
|
-
*
|
|
104
|
-
* When `options.filters` is a function, it is re-read during host updates so
|
|
105
|
-
* the selection can follow reactive host state. If `queryClient` is omitted,
|
|
106
|
-
* the controller resolves the client from the nearest connected
|
|
107
|
-
* `QueryClientProvider`.
|
|
108
|
-
*
|
|
109
|
-
* @param host - The Lit reactive controller host that owns the mutation cache
|
|
110
|
-
* subscription.
|
|
111
|
-
* @param options - Mutation state filters and optional selector.
|
|
112
|
-
* @param queryClient - Optional explicit query client. Provide this for
|
|
113
|
-
* controllers that should not resolve a client from Lit context.
|
|
114
|
-
* @returns An accessor for the selected mutation state array.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* ```ts
|
|
118
|
-
* import { LitElement, html } from 'lit'
|
|
119
|
-
* import { useMutationState } from '@tanstack/lit-query'
|
|
120
|
-
*
|
|
121
|
-
* class PendingUploads extends LitElement {
|
|
122
|
-
* private readonly uploads = useMutationState(this, {
|
|
123
|
-
* filters: { mutationKey: ['upload'], status: 'pending' },
|
|
124
|
-
* select: (mutation) => mutation.state.variables as File,
|
|
125
|
-
* })
|
|
126
|
-
*
|
|
127
|
-
* render() {
|
|
128
|
-
* return html`<span>${this.uploads().length} uploads pending</span>`
|
|
129
|
-
* }
|
|
130
|
-
* }
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
function useMutationState(host, options = {}, queryClient) {
|
|
134
|
-
const controller = new MutationStateController(host, options, queryClient);
|
|
135
|
-
return Object.assign((0, accessor_js_1.createValueAccessor)(() => controller.current), {
|
|
136
|
-
destroy: () => controller.destroy(),
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
//# sourceMappingURL=useMutationState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMutationState.js","sourceRoot":"","sources":["../src/useMutationState.ts"],"names":[],"mappings":";;AA+LA,4CAcC;AA7MD,qDAM6B;AAE7B,+CAKsB;AACtB,uEAAgE;AAuBhE,MAAM,uBAAiC,SAAQ,kCAAyB;IAMnD;IALX,WAAW,CAAyB;IACpC,WAAW,CAA0B;IAE7C,YACE,IAA4B,EACX,OAAsC,EACvD,WAAyB;QAEzB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAAA;QAHX,YAAO,GAAP,OAAO,CAA+B;QAKvD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;IACnC,CAAC;IAES,WAAW;QACnB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YACvB,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAA;YACzB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAA;QAChB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAA;IAC5C,CAAC;IAES,cAAc;QACtB,IAAI,CAAC,WAAW,EAAE,EAAE,CAAA;QACp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