Fix
Some checks failed
Lint / lint (push) Failing after 2s

This commit is contained in:
Julien Valverdé
2025-09-25 02:51:23 +02:00
parent a7471c0d49
commit 5f531c9b2e

View File

@@ -51,19 +51,21 @@ extends Pipeable.Class() implements Form<A, I, R> {
} }
makeFieldIssuesSubscribable<const P extends PropertyPath.Paths<A>>(path: P) { makeFieldIssuesSubscribable<const P extends PropertyPath.Paths<A>>(path: P) {
const filter = Option.match({ const errorRef = this.errorRef
return pipe(
Option.match({
onSome: (v: ParseResult.ParseError) => Effect.andThen( onSome: (v: ParseResult.ParseError) => Effect.andThen(
ParseResult.ArrayFormatter.formatError(v), ParseResult.ArrayFormatter.formatError(v),
Array.filter(issue => PropertyPath.equivalence(issue.path, path)), Array.filter(issue => PropertyPath.equivalence(issue.path, path)),
), ),
onNone: () => Effect.succeed([]), onNone: () => Effect.succeed([]),
}) }),
const errorRef = this.errorRef filter => SubscribableInternal.make({
return SubscribableInternal.make({
get: Effect.flatMap(errorRef.get, filter), get: Effect.flatMap(errorRef.get, filter),
get changes() { return Stream.flatMap(errorRef.changes, filter) }, get changes() { return Stream.flatMap(errorRef.changes, filter) },
}) }),
)
} }
} }