diff --git a/packages/effect-fc/src/SynchronizedForm.ts b/packages/effect-fc/src/SynchronizedForm.ts index 3233588..ec6644e 100644 --- a/packages/effect-fc/src/SynchronizedForm.ts +++ b/packages/effect-fc/src/SynchronizedForm.ts @@ -148,9 +148,11 @@ export const make = Effect.fnUntraced(function* (Array.empty())) const validationFiberLens = Lens.fromSubscriptionRef(yield* SubscriptionRef.make(Option.none>())) const isCommittingLens = Lens.fromSubscriptionRef(yield* SubscriptionRef.make(false)) - const initialEncodedValue = yield* Lens.get(options.target).pipe( - Effect.flatMap(Schema.encode(options.schema, { errors: "all" })), - ) + + const initialEncodedValue = options.initialEncodedValue ?? (yield* Effect.flatMap( + Lens.get(options.target), + Schema.encode(options.schema, { errors: "all" }), + )) return new SynchronizedFormImpl( options.schema,