@pathscale/ui 2.11.13 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-grid/DataGrid.interactions.d.ts +2 -1
- package/dist/hooks/data/createMutation.d.ts +29 -0
- package/dist/hooks/data/createMutation.js +50 -0
- package/dist/hooks/data/createQuery.d.ts +81 -0
- package/dist/hooks/data/createQuery.js +72 -0
- package/dist/hooks/data/createQuery.test.d.ts +1 -0
- package/dist/hooks/data/createQuery.test.js +207 -0
- package/dist/hooks/data/index.d.ts +4 -0
- package/dist/hooks/data/index.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/layouts.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from "@solidjs/web";
|
|
1
2
|
import type { DataGridColumn, DataGridRow } from "./createDataGrid";
|
|
2
3
|
export declare const formatCell: (value: unknown) => string;
|
|
3
4
|
export declare const columnSpan: (visible: number, hasSelection: boolean) => number;
|
|
@@ -5,7 +6,7 @@ export declare const columnSpan: (visible: number, hasSelection: boolean) => num
|
|
|
5
6
|
export declare const pageLabel: (page: number, pageCount: number) => string;
|
|
6
7
|
export declare const rangeLabel: (page: number, pageSize: number, total: number) => string;
|
|
7
8
|
export declare const searchPlaceholder: (label: string) => string;
|
|
8
|
-
export declare const cellContent: <Row extends DataGridRow>(column: DataGridColumn<Row>, row: Row, index: number) =>
|
|
9
|
+
export declare const cellContent: <Row extends DataGridRow>(column: DataGridColumn<Row>, row: Row, index: number) => JSX.Element;
|
|
9
10
|
export declare const readInputValue: (event: {
|
|
10
11
|
currentTarget: HTMLInputElement;
|
|
11
12
|
}) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A write, without a query library. The companion to `createQuery`.
|
|
3
|
+
*
|
|
4
|
+
* Replaces `useMutation`. The same rule applies as there: reading this never
|
|
5
|
+
* suspends and never throws. `mutate` reports failure through `error`;
|
|
6
|
+
* `mutateAsync` rejects, for a caller that wants to await and handle it.
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateMutationOptions<TArgs extends unknown[], TResult> {
|
|
9
|
+
mutationFn: (...args: TArgs) => Promise<TResult>;
|
|
10
|
+
onSuccess?: (result: TResult, ...args: TArgs) => void | Promise<void>;
|
|
11
|
+
onError?: (error: unknown, ...args: TArgs) => void;
|
|
12
|
+
/** Runs after success or failure, like TanStack's `onSettled`. */
|
|
13
|
+
onSettled?: () => void | Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/** Read as properties, for the same reason as `QueryResult`. */
|
|
16
|
+
export interface MutationResult<TArgs extends unknown[], TResult> {
|
|
17
|
+
/** Fire and forget. Failure lands on `error` rather than as a rejection. */
|
|
18
|
+
mutate: (...args: TArgs) => void;
|
|
19
|
+
/** Fire and await. Rejects on failure. */
|
|
20
|
+
mutateAsync: (...args: TArgs) => Promise<TResult>;
|
|
21
|
+
readonly isPending: boolean;
|
|
22
|
+
readonly error: unknown;
|
|
23
|
+
readonly isError: boolean;
|
|
24
|
+
/** The last successful result. */
|
|
25
|
+
readonly data: TResult | undefined;
|
|
26
|
+
/** Clear `error` and `data`. */
|
|
27
|
+
reset: () => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const createMutation: <TArgs extends unknown[], TResult>(options: () => CreateMutationOptions<TArgs, TResult>) => MutationResult<TArgs, TResult>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createSignal } from "solid-js";
|
|
2
|
+
const createMutation = (options)=>{
|
|
3
|
+
const [isPending, setIsPending] = createSignal(false);
|
|
4
|
+
const [error, setError] = createSignal(void 0);
|
|
5
|
+
const [data, setData] = createSignal(void 0);
|
|
6
|
+
let inFlight = 0;
|
|
7
|
+
const mutateAsync = async (...args)=>{
|
|
8
|
+
const { mutationFn, onSuccess, onError, onSettled } = options();
|
|
9
|
+
inFlight++;
|
|
10
|
+
setIsPending(true);
|
|
11
|
+
setError(void 0);
|
|
12
|
+
try {
|
|
13
|
+
const result = await mutationFn(...args);
|
|
14
|
+
setData(()=>result);
|
|
15
|
+
await onSuccess?.(result, ...args);
|
|
16
|
+
return result;
|
|
17
|
+
} catch (caught) {
|
|
18
|
+
setError(()=>caught);
|
|
19
|
+
onError?.(caught, ...args);
|
|
20
|
+
throw caught;
|
|
21
|
+
} finally{
|
|
22
|
+
inFlight--;
|
|
23
|
+
if (0 === inFlight) setIsPending(false);
|
|
24
|
+
await onSettled?.();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
mutate: (...args)=>{
|
|
29
|
+
mutateAsync(...args).catch(()=>{});
|
|
30
|
+
},
|
|
31
|
+
mutateAsync,
|
|
32
|
+
get isPending () {
|
|
33
|
+
return isPending();
|
|
34
|
+
},
|
|
35
|
+
get error () {
|
|
36
|
+
return error();
|
|
37
|
+
},
|
|
38
|
+
get isError () {
|
|
39
|
+
return void 0 !== error();
|
|
40
|
+
},
|
|
41
|
+
get data () {
|
|
42
|
+
return data();
|
|
43
|
+
},
|
|
44
|
+
reset: ()=>{
|
|
45
|
+
setError(void 0);
|
|
46
|
+
setData(()=>void 0);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export { createMutation };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asynchronous reads, without a query library.
|
|
3
|
+
*
|
|
4
|
+
* This exists to replace `@tanstack/solid-query`, and the replacement is not a
|
|
5
|
+
* like-for-like port. One behaviour is deliberately different, and it is the
|
|
6
|
+
* reason this file exists rather than a wrapper around the old one:
|
|
7
|
+
*
|
|
8
|
+
* **A query that has not run is not pending, and reading it never suspends.**
|
|
9
|
+
*
|
|
10
|
+
* TanStack keeps a query that has never fetched -- including one held back by
|
|
11
|
+
* `enabled: false` -- at `status: "pending"` forever. Under Solid 2, reading a
|
|
12
|
+
* pending query throws `NotReadyError` to suspend. A widget whose query was
|
|
13
|
+
* disabled therefore suspended for the lifetime of the page, and because
|
|
14
|
+
* `NotReadyError` extends `Error` with no message, a boundary that caught it
|
|
15
|
+
* had nothing to print. That is how a support-chat button that had not
|
|
16
|
+
* connected replaced an entire application with a blank error page.
|
|
17
|
+
*
|
|
18
|
+
* Here, `data` is `undefined` until there is data, `isLoading` is true only
|
|
19
|
+
* while a fetch is actually in flight, and neither ever throws. A caller that
|
|
20
|
+
* wants to suspend can do so explicitly; a caller that forgets cannot take the
|
|
21
|
+
* page down.
|
|
22
|
+
*/
|
|
23
|
+
export interface CreateQueryOptions<T> {
|
|
24
|
+
/**
|
|
25
|
+
* Identity, for invalidation. Compared by value, and matched by prefix, so
|
|
26
|
+
* `["users"]` invalidates `["users", 1]` as well.
|
|
27
|
+
*/
|
|
28
|
+
key: readonly unknown[];
|
|
29
|
+
/** The read itself. Only called when `enabled` is not false. */
|
|
30
|
+
fetcher: () => Promise<T>;
|
|
31
|
+
/** Held back while false. Default true. */
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read as properties, not as accessors.
|
|
36
|
+
*
|
|
37
|
+
* `solid-query` returned a store, so every consumer of it is written
|
|
38
|
+
* `query.data`, `query.isLoading`, `query.isError` -- roughly three thousand
|
|
39
|
+
* such reads across these applications. Exposing accessors here would mean
|
|
40
|
+
* editing all of them to add `()`, turning a migration of the ~300 files that
|
|
41
|
+
* *define* queries into one that touches every file that reads one.
|
|
42
|
+
*
|
|
43
|
+
* These are getters over signals, so a read inside a tracked scope still
|
|
44
|
+
* subscribes exactly as an accessor call would.
|
|
45
|
+
*/
|
|
46
|
+
export interface QueryResult<T> {
|
|
47
|
+
/** The last value read, or `undefined` before the first one arrives. */
|
|
48
|
+
readonly data: T | undefined;
|
|
49
|
+
/** The last failure, cleared by the next successful read. */
|
|
50
|
+
readonly error: unknown;
|
|
51
|
+
/** True only while a fetch is in flight. Never true for a disabled query. */
|
|
52
|
+
readonly isLoading: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Alias of `isLoading`, for call sites carried over from `solid-query`.
|
|
55
|
+
*
|
|
56
|
+
* Note the deliberate difference in meaning. There, `isPending` was "has no
|
|
57
|
+
* data", which stayed true forever for a query held back by `enabled: false`
|
|
58
|
+
* -- so `if (isPending) return <Spinner/>` spun for the life of the page.
|
|
59
|
+
* Here it means "a fetch is in flight", so a disabled query reads as not
|
|
60
|
+
* pending and its consumer renders instead of hanging.
|
|
61
|
+
*/
|
|
62
|
+
readonly isPending: boolean;
|
|
63
|
+
/** True when the last read failed. */
|
|
64
|
+
readonly isError: boolean;
|
|
65
|
+
/** True when a value has arrived and the last read did not fail. */
|
|
66
|
+
readonly isSuccess: boolean;
|
|
67
|
+
/** True once a value has arrived at least once. */
|
|
68
|
+
readonly isReady: boolean;
|
|
69
|
+
/** Read again now, regardless of `enabled`. */
|
|
70
|
+
refetch: () => Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Re-read every live query whose key starts with `prefix`.
|
|
74
|
+
*
|
|
75
|
+
* The replacement for `useQueryClient().invalidateQueries({ queryKey })`. It is
|
|
76
|
+
* a plain function rather than something read from context: invalidation is
|
|
77
|
+
* usually wanted from a mutation handler or a store, which are not components
|
|
78
|
+
* and have no context to read.
|
|
79
|
+
*/
|
|
80
|
+
export declare const invalidateQueries: (prefix: readonly unknown[]) => void;
|
|
81
|
+
export declare const createQuery: <T>(options: () => CreateQueryOptions<T>) => QueryResult<T>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { createRenderEffect, createSignal, onCleanup, untrack } from "solid-js";
|
|
2
|
+
const registry = new Set();
|
|
3
|
+
const isPrefix = (prefix, key)=>prefix.length <= key.length && prefix.every((part, index)=>Object.is(part, key[index]));
|
|
4
|
+
const invalidateQueries = (prefix)=>{
|
|
5
|
+
for (const entry of registry)if (isPrefix(prefix, entry.key)) entry.refetch();
|
|
6
|
+
};
|
|
7
|
+
const createQuery = (options)=>{
|
|
8
|
+
const [data, setData] = createSignal(void 0);
|
|
9
|
+
const [error, setError] = createSignal(void 0);
|
|
10
|
+
const [isLoading, setIsLoading] = createSignal(false);
|
|
11
|
+
const [isReady, setIsReady] = createSignal(false);
|
|
12
|
+
let generation = 0;
|
|
13
|
+
const run = async ()=>{
|
|
14
|
+
const mine = ++generation;
|
|
15
|
+
const { fetcher } = untrack(options);
|
|
16
|
+
setIsLoading(true);
|
|
17
|
+
try {
|
|
18
|
+
const value = await fetcher();
|
|
19
|
+
if (mine !== generation) return;
|
|
20
|
+
setData(()=>value);
|
|
21
|
+
setError(void 0);
|
|
22
|
+
setIsReady(true);
|
|
23
|
+
} catch (caught) {
|
|
24
|
+
if (mine !== generation) return;
|
|
25
|
+
setError(()=>caught);
|
|
26
|
+
} finally{
|
|
27
|
+
if (mine === generation) setIsLoading(false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
createRenderEffect(()=>options(), ({ key, enabled = true })=>{
|
|
31
|
+
if (!enabled) {
|
|
32
|
+
generation++;
|
|
33
|
+
setIsLoading(false);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const entry = {
|
|
37
|
+
key,
|
|
38
|
+
refetch: ()=>void run()
|
|
39
|
+
};
|
|
40
|
+
registry.add(entry);
|
|
41
|
+
onCleanup(()=>registry.delete(entry));
|
|
42
|
+
run();
|
|
43
|
+
});
|
|
44
|
+
onCleanup(()=>{
|
|
45
|
+
generation++;
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
get data () {
|
|
49
|
+
return data();
|
|
50
|
+
},
|
|
51
|
+
get error () {
|
|
52
|
+
return error();
|
|
53
|
+
},
|
|
54
|
+
get isLoading () {
|
|
55
|
+
return isLoading();
|
|
56
|
+
},
|
|
57
|
+
get isPending () {
|
|
58
|
+
return isLoading();
|
|
59
|
+
},
|
|
60
|
+
get isError () {
|
|
61
|
+
return void 0 !== error();
|
|
62
|
+
},
|
|
63
|
+
get isSuccess () {
|
|
64
|
+
return isReady() && void 0 === error();
|
|
65
|
+
},
|
|
66
|
+
get isReady () {
|
|
67
|
+
return isReady();
|
|
68
|
+
},
|
|
69
|
+
refetch: run
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export { createQuery, invalidateQueries };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { createRenderEffect, createRoot, flush } from "solid-js";
|
|
3
|
+
import { createMutation } from "./createMutation.js";
|
|
4
|
+
import { createQuery, invalidateQueries } from "./createQuery.js";
|
|
5
|
+
const tick = ()=>new Promise((resolve)=>setTimeout(resolve, 0));
|
|
6
|
+
describe("createQuery", ()=>{
|
|
7
|
+
test("a disabled query is not loading, and never throws", async ()=>{
|
|
8
|
+
let calls = 0;
|
|
9
|
+
const dispose = createRoot((d)=>{
|
|
10
|
+
const q = createQuery(()=>({
|
|
11
|
+
key: [
|
|
12
|
+
"never"
|
|
13
|
+
],
|
|
14
|
+
enabled: false,
|
|
15
|
+
fetcher: async ()=>{
|
|
16
|
+
calls++;
|
|
17
|
+
return "value";
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
expect(q.isLoading).toBe(false);
|
|
21
|
+
expect(q.data).toBeUndefined();
|
|
22
|
+
expect(q.isReady).toBe(false);
|
|
23
|
+
return d;
|
|
24
|
+
});
|
|
25
|
+
await tick();
|
|
26
|
+
expect(calls).toBe(0);
|
|
27
|
+
dispose();
|
|
28
|
+
});
|
|
29
|
+
test("reads, and reports readiness", async ()=>{
|
|
30
|
+
let resolveFetch;
|
|
31
|
+
const result = await createRoot(async (dispose)=>{
|
|
32
|
+
const q = createQuery(()=>({
|
|
33
|
+
key: [
|
|
34
|
+
"thing"
|
|
35
|
+
],
|
|
36
|
+
fetcher: ()=>new Promise((r)=>resolveFetch = r)
|
|
37
|
+
}));
|
|
38
|
+
flush();
|
|
39
|
+
const whileLoading = {
|
|
40
|
+
loading: q.isLoading,
|
|
41
|
+
ready: q.isReady
|
|
42
|
+
};
|
|
43
|
+
resolveFetch?.("hello");
|
|
44
|
+
await tick();
|
|
45
|
+
return {
|
|
46
|
+
whileLoading,
|
|
47
|
+
data: q.data,
|
|
48
|
+
ready: q.isReady,
|
|
49
|
+
dispose
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
expect(result.whileLoading).toEqual({
|
|
53
|
+
loading: true,
|
|
54
|
+
ready: false
|
|
55
|
+
});
|
|
56
|
+
expect(result.data).toBe("hello");
|
|
57
|
+
expect(result.ready).toBe(true);
|
|
58
|
+
result.dispose();
|
|
59
|
+
});
|
|
60
|
+
test("a failure lands on error rather than being thrown", async ()=>{
|
|
61
|
+
const result = await createRoot(async (dispose)=>{
|
|
62
|
+
const q = createQuery(()=>({
|
|
63
|
+
key: [
|
|
64
|
+
"bad"
|
|
65
|
+
],
|
|
66
|
+
fetcher: async ()=>{
|
|
67
|
+
throw new Error("nope");
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
flush();
|
|
71
|
+
await tick();
|
|
72
|
+
return {
|
|
73
|
+
error: q.error,
|
|
74
|
+
loading: q.isLoading,
|
|
75
|
+
dispose
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
expect(result.error.message).toBe("nope");
|
|
79
|
+
expect(result.loading).toBe(false);
|
|
80
|
+
result.dispose();
|
|
81
|
+
});
|
|
82
|
+
test("invalidateQueries matches by key prefix", async ()=>{
|
|
83
|
+
let calls = 0;
|
|
84
|
+
const dispose = createRoot((d)=>{
|
|
85
|
+
createQuery(()=>({
|
|
86
|
+
key: [
|
|
87
|
+
"users",
|
|
88
|
+
1
|
|
89
|
+
],
|
|
90
|
+
fetcher: async ()=>{
|
|
91
|
+
calls++;
|
|
92
|
+
return calls;
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
flush();
|
|
96
|
+
return d;
|
|
97
|
+
});
|
|
98
|
+
await tick();
|
|
99
|
+
expect(calls).toBe(1);
|
|
100
|
+
invalidateQueries([
|
|
101
|
+
"users"
|
|
102
|
+
]);
|
|
103
|
+
await tick();
|
|
104
|
+
expect(calls).toBe(2);
|
|
105
|
+
invalidateQueries([
|
|
106
|
+
"apps"
|
|
107
|
+
]);
|
|
108
|
+
await tick();
|
|
109
|
+
expect(calls).toBe(2);
|
|
110
|
+
dispose();
|
|
111
|
+
});
|
|
112
|
+
test("a disposed query deregisters, so invalidation cannot reach it", async ()=>{
|
|
113
|
+
let calls = 0;
|
|
114
|
+
const dispose = createRoot((d)=>{
|
|
115
|
+
createQuery(()=>({
|
|
116
|
+
key: [
|
|
117
|
+
"gone"
|
|
118
|
+
],
|
|
119
|
+
fetcher: async ()=>{
|
|
120
|
+
calls++;
|
|
121
|
+
return calls;
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
flush();
|
|
125
|
+
return d;
|
|
126
|
+
});
|
|
127
|
+
await tick();
|
|
128
|
+
expect(calls).toBe(1);
|
|
129
|
+
dispose();
|
|
130
|
+
invalidateQueries([
|
|
131
|
+
"gone"
|
|
132
|
+
]);
|
|
133
|
+
await tick();
|
|
134
|
+
expect(calls).toBe(1);
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
describe("property reads stay reactive", ()=>{
|
|
138
|
+
test("a tracked scope re-runs when data lands", async ()=>{
|
|
139
|
+
let resolveFetch;
|
|
140
|
+
const seen = [];
|
|
141
|
+
const result = await createRoot(async (dispose)=>{
|
|
142
|
+
const q = createQuery(()=>({
|
|
143
|
+
key: [
|
|
144
|
+
"reactive"
|
|
145
|
+
],
|
|
146
|
+
fetcher: ()=>new Promise((r)=>resolveFetch = r)
|
|
147
|
+
}));
|
|
148
|
+
createRenderEffect(()=>q.data, (value)=>{
|
|
149
|
+
seen.push(value);
|
|
150
|
+
});
|
|
151
|
+
flush();
|
|
152
|
+
resolveFetch?.("arrived");
|
|
153
|
+
await tick();
|
|
154
|
+
flush();
|
|
155
|
+
return {
|
|
156
|
+
dispose
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
expect(seen[0]).toBeUndefined();
|
|
160
|
+
expect(seen.at(-1)).toBe("arrived");
|
|
161
|
+
result.dispose();
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
describe("createMutation", ()=>{
|
|
165
|
+
test("mutate reports failure without an unhandled rejection", async ()=>{
|
|
166
|
+
const result = await createRoot(async (dispose)=>{
|
|
167
|
+
const m = createMutation(()=>({
|
|
168
|
+
mutationFn: async ()=>{
|
|
169
|
+
throw new Error("write failed");
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
m.mutate();
|
|
173
|
+
await tick();
|
|
174
|
+
return {
|
|
175
|
+
error: m.error,
|
|
176
|
+
pending: m.isPending,
|
|
177
|
+
dispose
|
|
178
|
+
};
|
|
179
|
+
});
|
|
180
|
+
expect(result.error.message).toBe("write failed");
|
|
181
|
+
expect(result.pending).toBe(false);
|
|
182
|
+
result.dispose();
|
|
183
|
+
});
|
|
184
|
+
test("mutateAsync rejects, and onSuccess sees the result", async ()=>{
|
|
185
|
+
const seen = [];
|
|
186
|
+
const result = await createRoot(async (dispose)=>{
|
|
187
|
+
const m = createMutation(()=>({
|
|
188
|
+
mutationFn: async (name)=>`made ${name}`,
|
|
189
|
+
onSuccess: (r)=>{
|
|
190
|
+
seen.push(r);
|
|
191
|
+
}
|
|
192
|
+
}));
|
|
193
|
+
const value = await m.mutateAsync("app");
|
|
194
|
+
return {
|
|
195
|
+
value,
|
|
196
|
+
data: m.data,
|
|
197
|
+
dispose
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
expect(result.value).toBe("made app");
|
|
201
|
+
expect(result.data).toBe("made app");
|
|
202
|
+
expect(seen).toEqual([
|
|
203
|
+
"made app"
|
|
204
|
+
]);
|
|
205
|
+
result.dispose();
|
|
206
|
+
});
|
|
207
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -121,6 +121,8 @@ export type { Align, CapabilityProps, ChangeReason, Constraint, Controlled, Dire
|
|
|
121
121
|
export { FLAVORS, isInvalid, resolveState, SIZES, SPACES, STATES, VARIANTS, } from "./components/vocabulary";
|
|
122
122
|
export type { AnyFormApi, CreateFormOptions, FormApi, UseFieldResult, } from "./hooks/form";
|
|
123
123
|
export { createForm, FormContext, getFirstFieldError, useField, useFormContext, } from "./hooks/form";
|
|
124
|
+
export type { CreateMutationOptions, CreateQueryOptions, MutationResult, QueryResult, } from "./hooks/data";
|
|
125
|
+
export { createMutation, createQuery, invalidateQueries, } from "./hooks/data";
|
|
124
126
|
export { useDesktop } from "./hooks/layout";
|
|
125
127
|
export type { UseAnchoredOverlayPositionOptions } from "./hooks/table";
|
|
126
128
|
export { useAnchoredOverlayPosition } from "./hooks/table";
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,7 @@ export { DEFAULT_GAP as DEFAULT_TOAST_GAP, DEFAULT_MAX_VISIBLE_TOAST, DEFAULT_SC
|
|
|
72
72
|
export { TooltipArrow, TooltipContent, TooltipTrigger, default as Tooltip } from "./components/tooltip/index.js";
|
|
73
73
|
export { FLAVORS, SIZES, SPACES, STATES, VARIANTS, isInvalid, resolveState } from "./components/vocabulary.js";
|
|
74
74
|
export { FormContext, createForm, getFirstFieldError, useField, useFormContext } from "./hooks/form/index.js";
|
|
75
|
+
export { createMutation, createQuery, invalidateQueries } from "./hooks/data/index.js";
|
|
75
76
|
export { useDesktop } from "./hooks/layout/index.js";
|
|
76
77
|
export { useAnchoredOverlayPosition } from "./hooks/table/index.js";
|
|
77
78
|
export { evaluatePasswordRules, matchPasswordConfirmation } from "./passwordRules.js";
|