@r2digisolutions/components 0.25.3 → 0.25.4
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.
|
@@ -37,13 +37,17 @@
|
|
|
37
37
|
*/
|
|
38
38
|
syncRemoteIssues?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
* When `false`, skip Kit's default `
|
|
40
|
+
* When `false`, skip Kit's default `refreshAll()` after a successful remote form
|
|
41
41
|
* (via `submit().updates()`). Prefer {@link updates} to refresh specific queries.
|
|
42
42
|
* @default true
|
|
43
43
|
*/
|
|
44
|
+
refreshAll?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use {@link refreshAll}. Kept for apps still on the old name.
|
|
47
|
+
*/
|
|
44
48
|
invalidateAll?: boolean;
|
|
45
49
|
/**
|
|
46
|
-
* Single-flight query refreshes. Passing this (even `[]`) opts out of `
|
|
50
|
+
* Single-flight query refreshes. Passing this (even `[]`) opts out of `refreshAll`.
|
|
47
51
|
* @see https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations
|
|
48
52
|
*/
|
|
49
53
|
updates?: RemoteQueryUpdate[];
|
|
@@ -77,7 +81,8 @@
|
|
|
77
81
|
disabled = false,
|
|
78
82
|
remote = null,
|
|
79
83
|
syncRemoteIssues = true,
|
|
80
|
-
|
|
84
|
+
refreshAll,
|
|
85
|
+
invalidateAll,
|
|
81
86
|
updates,
|
|
82
87
|
onSuccess,
|
|
83
88
|
onError,
|
|
@@ -261,14 +266,16 @@
|
|
|
261
266
|
});
|
|
262
267
|
}
|
|
263
268
|
|
|
264
|
-
|
|
269
|
+
const shouldRefreshAll = $derived(refreshAll ?? invalidateAll ?? true);
|
|
270
|
+
|
|
271
|
+
/** Kit: `submit().updates(...)` (even empty) prevents the default refreshAll waterfall. */
|
|
265
272
|
function runSubmit(
|
|
266
273
|
submit: () => Promise<boolean> & {
|
|
267
274
|
updates: (...args: RemoteQueryUpdate[]) => Promise<boolean>;
|
|
268
275
|
}
|
|
269
276
|
) {
|
|
270
277
|
if (updates) return submit().updates(...updates);
|
|
271
|
-
if (!
|
|
278
|
+
if (!shouldRefreshAll) return submit().updates();
|
|
272
279
|
return submit();
|
|
273
280
|
}
|
|
274
281
|
|
|
@@ -21,13 +21,17 @@ declare function $$render<TData extends FormDataValues = FormDataValues, TInput
|
|
|
21
21
|
*/
|
|
22
22
|
syncRemoteIssues?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
* When `false`, skip Kit's default `
|
|
24
|
+
* When `false`, skip Kit's default `refreshAll()` after a successful remote form
|
|
25
25
|
* (via `submit().updates()`). Prefer {@link updates} to refresh specific queries.
|
|
26
26
|
* @default true
|
|
27
27
|
*/
|
|
28
|
+
refreshAll?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use {@link refreshAll}. Kept for apps still on the old name.
|
|
31
|
+
*/
|
|
28
32
|
invalidateAll?: boolean;
|
|
29
33
|
/**
|
|
30
|
-
* Single-flight query refreshes. Passing this (even `[]`) opts out of `
|
|
34
|
+
* Single-flight query refreshes. Passing this (even `[]`) opts out of `refreshAll`.
|
|
31
35
|
* @see https://svelte.dev/docs/kit/remote-functions#Single-flight-mutations
|
|
32
36
|
*/
|
|
33
37
|
updates?: RemoteQueryUpdate[];
|