Fix
All checks were successful
Lint / lint (push) Successful in 14s

This commit is contained in:
Julien Valverdé
2026-04-28 22:06:24 +02:00
parent adf571fb73
commit 840e82debc

View File

@@ -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 }),