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) {
const filter = Option.match({
onSome: (v: ParseResult.ParseError) => Effect.andThen(
ParseResult.ArrayFormatter.formatError(v),
Array.filter(issue => PropertyPath.equivalence(issue.path, path)),
),
onNone: () => Effect.succeed([]),
})
const errorRef = this.errorRef
return SubscribableInternal.make({
get: Effect.flatMap(errorRef.get, filter),
get changes() { return Stream.flatMap(errorRef.changes, filter) },
})
return pipe(
Option.match({
onSome: (v: ParseResult.ParseError) => Effect.andThen(
ParseResult.ArrayFormatter.formatError(v),
Array.filter(issue => PropertyPath.equivalence(issue.path, path)),
),
onNone: () => Effect.succeed([]),
}),
filter => SubscribableInternal.make({
get: Effect.flatMap(errorRef.get, filter),
get changes() { return Stream.flatMap(errorRef.changes, filter) },
}),
)
}
}