From 840e82debc08cf11c1e294ce87d9cc6b6f495c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Tue, 28 Apr 2026 22:06:24 +0200 Subject: [PATCH] Fix --- packages/effect-fc/src/SynchronizedForm.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/effect-fc/src/SynchronizedForm.ts b/packages/effect-fc/src/SynchronizedForm.ts index ec6644e..71236f6 100644 --- a/packages/effect-fc/src/SynchronizedForm.ts +++ b/packages/effect-fc/src/SynchronizedForm.ts @@ -76,8 +76,9 @@ export class SynchronizedFormImpl< Schema.decode(this.schema, { errors: "all" })(encodedValue), exit => Effect.andThen( Exit.matchEffect(exit, { - onSuccess: v => Lens.set(this.value, Option.some(v)).pipe( - Effect.andThen(Lens.set(this.issues, Array.empty())), + onSuccess: v => Effect.andThen( + Lens.set(this.value, Option.some(v)), + Lens.set(this.issues, Array.empty()), ), onFailure: c => Option.match(Chunk.findFirst(Cause.failures(c), e => e._tag === "ParseError"), { onSome: e => Effect.flatMap( @@ -108,14 +109,15 @@ export class SynchronizedFormImpl< Stream.runForEach( Stream.drop(this.target.changes, 1), - targetValue => Schema.encode(this.schema, { errors: "all" })(targetValue).pipe( - Effect.flatMap(encodedValue => Effect.whenEffect( + targetValue => Effect.flatMap( + Schema.encode(this.schema, { errors: "all" })(targetValue), + encodedValue => Effect.whenEffect( Lens.set(this.encodedValue, encodedValue), Effect.map( Lens.get(this.encodedValue), currentEncodedValue => !Equal.equals(encodedValue, currentEncodedValue), ), - )), + ), ), ), ], { concurrency: "unbounded", discard: true }),