Form V2
All checks were successful
Lint / lint (push) Successful in 43s

This commit is contained in:
Julien Valverdé
2025-09-23 05:28:23 +02:00
parent 8b5074bd56
commit 7545b4bb30
2 changed files with 91 additions and 122 deletions

View File

@@ -14,16 +14,16 @@ const RegisterFormSchema = Schema.Struct({
class RegisterForm extends Effect.Service<RegisterForm>()("RegisterForm", {
scoped: Form.make({
schema: RegisterFormSchema,
initialValue: { email: "", password: "" },
initialEncodedValue: { email: "", password: "" },
})
}) {}
class RegisterPage extends Component.makeUntraced(function* RegisterPage() {
const form = yield* RegisterForm
const emailInput = yield* form.useInput({ path: ["email"], defaultValue: "" })
const passwordInput = yield* form.useInput({ path: ["password"], defaultValue: "" })
const emailInput = yield* Form.useInput(form, { path: ["email"] })
const passwordInput = yield* Form.useInput(form, { path: ["password"] })
yield* useFork(() => Stream.runForEach(form.latestValueSubscribable.changes, Console.log), [])
yield* useFork(() => Stream.runForEach(form.valueRef.changes, Console.log), [])
return (
<Container>