0.1.5 (#15)
All checks were successful
Lint / lint (push) Successful in 12s
Publish / publish (push) Successful in 19s

Co-authored-by: Renovate Bot <renovate-bot@valverde.cloud>
Co-authored-by: Julien Valverdé <julien.valverde@mailo.com>
Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
2025-10-20 06:34:59 +02:00
parent 7bba444776
commit 6bf4e33c29
9 changed files with 68 additions and 114 deletions

View File

@@ -39,7 +39,7 @@ class RegisterForm extends Effect.Service<RegisterForm>()("RegisterForm", {
),
initialEncodedValue: { email: "", password: "", birth: Option.none() },
submit: v => Effect.sleep("500 millis").pipe(
onSubmit: v => Effect.sleep("500 millis").pipe(
Effect.andThen(Console.log(v)),
Effect.andThen(Effect.sync(() => alert("Done!"))),
),
@@ -47,7 +47,7 @@ class RegisterForm extends Effect.Service<RegisterForm>()("RegisterForm", {
})
}) {}
class RegisterPage extends Component.makeUntraced("RegisterPage")(function*() {
class RegisterFormView extends Component.makeUntraced("RegisterFormView")(function*() {
const form = yield* RegisterForm
const submit = yield* Form.useSubmit(form)
const [canSubmit] = yield* Hooks.useSubscribables(form.canSubmitSubscribable)
@@ -84,16 +84,18 @@ class RegisterPage extends Component.makeUntraced("RegisterPage")(function*() {
)
}) {}
const RegisterPage = Component.makeUntraced("RegisterPage")(function*() {
const RegisterFormViewFC = yield* Effect.provide(
RegisterFormView,
yield* Hooks.useContext(RegisterForm.Default, { finalizerExecutionMode: "fork" }),
)
return <RegisterFormViewFC />
}).pipe(
Component.withRuntime(runtime.context)
)
export const Route = createFileRoute("/form")({
component: Component.makeUntraced("RegisterRoute")(function*() {
const RegisterRouteFC = yield* Effect.provide(
RegisterPage,
yield* Hooks.useContext(RegisterForm.Default, { finalizerExecutionMode: "fork" }),
)
return <RegisterRouteFC />
}).pipe(
Component.withRuntime(runtime.context)
)
component: RegisterPage
})