Skip to content

Commit 9de83ee

Browse files
committed
Simplified test 298.
1 parent 6e6c498 commit 9de83ee

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/routes/tests/issue-298/+page.svelte

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { z } from 'zod';
33
import { superForm as _superForm } from '$lib/client';
44
import { superValidateSync } from '$lib/client';
5-
import SuperDebug from '$lib/client/SuperDebug.svelte';
65
76
function ruleSet<T extends readonly [string, ...string[]]>(options: T) {
87
let prev: string | undefined = undefined;
@@ -14,8 +13,10 @@
1413
})
1514
.transform((value) => {
1615
const output = { ...value, prev: prev };
17-
prev = current;
18-
current = value.options as string;
16+
if (value.options != current) {
17+
prev = current;
18+
current = value.options as string;
19+
}
1920
return output;
2021
});
2122
}
@@ -28,8 +29,6 @@
2829
r2: ruleSet(r2)
2930
});
3031
31-
type T = z.infer<typeof schema>;
32-
3332
const superForm = _superForm(superValidateSync(schema), {
3433
SPA: true,
3534
dataType: 'json',
@@ -40,7 +39,9 @@
4039
$: ({ form } = superForm);
4140
</script>
4241

43-
<SuperDebug data={$form} />
42+
<h4>
43+
{$form.r1.options}-{$form.r1.prev} / {$form.r2.options}-{$form.r2.prev}
44+
</h4>
4445

4546
<form use:superForm.enhance method="post">
4647
{#each r1 as item}

0 commit comments

Comments
 (0)