@@ -55,24 +55,6 @@ extends Pipeable.Class() implements Form<A, I, R, SA, SE, SR> {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
makeFieldIssuesSubscribable<const P extends PropertyPath.Paths<A>>(path: P) {
|
|
||||||
const errorRef = this.errorRef
|
|
||||||
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) },
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user