From 5f8965ce113db0d2b471574d508fc27396ce8f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sat, 28 Mar 2026 10:37:11 +0100 Subject: [PATCH] Refactor Form --- packages/effect-fc/src/Form.ts | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/effect-fc/src/Form.ts b/packages/effect-fc/src/Form.ts index 7e65d70..2d31400 100644 --- a/packages/effect-fc/src/Form.ts +++ b/packages/effect-fc/src/Form.ts @@ -11,33 +11,33 @@ import * as SubscriptionRef from "./SubscriptionRef.js" export const FormTypeId: unique symbol = Symbol.for("@effect-fc/Form/Form") export type FormTypeId = typeof FormTypeId -export interface Form +export interface Form extends Pipeable.Pipeable { readonly [FormTypeId]: FormTypeId readonly path: P - readonly value: Subscribable.Subscribable> - readonly encodedValue: Lens.Lens - readonly error: Subscribable.Subscribable> - readonly validationFiber: Subscribable.Subscribable>> - readonly canSubmit: Subscribable.Subscribable + readonly value: Subscribable.Subscribable, ER, never> + readonly encodedValue: Lens.Lens + readonly error: Subscribable.Subscribable, ER, never> + readonly validationFiber: Subscribable.Subscribable>, ER, never> + readonly canSubmit: Subscribable.Subscribable } export const FormImplTypeId: unique symbol = Symbol.for("@effect-fc/Form/FormImpl") export type FormImplTypeId = typeof FormImplTypeId -export class FormImpl -extends Pipeable.Class() implements Form { +export class FormImpl +extends Pipeable.Class() implements Form { readonly [FormTypeId]: FormTypeId = FormTypeId readonly [FormImplTypeId]: FormImplTypeId = FormImplTypeId constructor( readonly path: P, - readonly value: Lens.Lens>, - readonly encodedValue: Lens.Lens, - readonly error: Lens.Lens>, - readonly validationFiber: Lens.Lens>>, - readonly canSubmit: Subscribable.Subscribable, + readonly value: Lens.Lens, ER, EW, never, never>, + readonly encodedValue: Lens.Lens, + readonly error: Lens.Lens, ER, EW, never, never>, + readonly validationFiber: Lens.Lens>, ER, EW, never, never>, + readonly canSubmit: Subscribable.Subscribable, ) { super() } @@ -48,7 +48,7 @@ export const RootFormTypeId: unique symbol = Symbol.for("@effect-fc/Form/RootFor export type RootFormTypeId = typeof RootFormTypeId export interface RootForm -extends Form { +extends Form { readonly schema: Schema.Schema readonly context: Context.Context readonly mutation: Mutation.Mutation< @@ -74,11 +74,11 @@ extends FormImpl implements RootForm >, readonly autosubmit: boolean, - value: Lens.Lens>, - encodedValue: Lens.Lens, - error: Lens.Lens>, - validationFiber: Lens.Lens>>, - canSubmit: Subscribable.Subscribable, + value: Lens.Lens, never, never, never, never>, + encodedValue: Lens.Lens, + error: Lens.Lens, never, never, never, never>, + validationFiber: Lens.Lens>, never, never, never, never>, + canSubmit: Subscribable.Subscribable, readonly runSemaphore: Effect.Semaphore, ) {