0.1.4 #5

Merged
Thilawyn merged 67 commits from next into master 2025-10-02 18:18:23 +02:00
Showing only changes of commit f6e69a05fd - Show all commits

View File

@@ -11,19 +11,19 @@ export type TypeId = typeof TypeId
export interface Form<in out A, in out I = A, out R = never>
extends Pipeable.Pipeable {
readonly schema: Schema.Schema<A, I, R>
readonly latestValueSubscribable: Subscribable.Subscribable<NoInfer<A>>
readonly latestValueSubscribable: Subscribable.Subscribable<A>
useFieldLatestValueSubscribable<P extends PropertyPath.Paths<NoInfer<A>>>(
useFieldLatestValueSubscribable<P extends PropertyPath.Paths<A>>(
path: P
): Subscribable.Subscribable<PropertyPath.ValueFromPath<NoInfer<A>, P>, NoSuchElementException>
): Subscribable.Subscribable<PropertyPath.ValueFromPath<A, P>, NoSuchElementException>
useFieldIssuesSubscribable(
path: PropertyPath.Paths<NoInfer<A>>
path: PropertyPath.Paths<A>
): Subscribable.Subscribable<readonly ParseResult.ArrayFormatterIssue[]>
useInput<P extends PropertyPath.Paths<NoInfer<I>>>(
useInput<P extends PropertyPath.Paths<I>>(
path: P
): Effect.Effect<
Form.useInput.Result<PropertyPath.ValueFromPath<NoInfer<I>, P>>,
Form.useInput.Result<PropertyPath.ValueFromPath<I, P>>,
ParseResult.ParseError | NoSuchElementException,
R
>
@@ -43,18 +43,18 @@ export namespace Form {
class FormImpl<in out A, in out I, out R>
extends Pipeable.Class() implements Form<A, I, R> {
readonly [TypeId]: TypeId = TypeId
readonly latestValueSubscribable: Subscribable.Subscribable<NoInfer<A>>
readonly latestValueSubscribable: Subscribable.Subscribable<A>
constructor(
readonly schema: Schema.Schema<A, I, R>,
readonly latestValueRef: SubscriptionRef.SubscriptionRef<NoInfer<A>>,
readonly latestValueRef: SubscriptionRef.SubscriptionRef<A>,
readonly errorRef: SubscriptionRef.SubscriptionRef<Option.Option<ParseResult.ParseError>>,
) {
super()
this.latestValueSubscribable = latestValueRef
}
useFieldLatestValueSubscribable<P extends PropertyPath.Paths<NoInfer<A>>>(
useFieldLatestValueSubscribable<P extends PropertyPath.Paths<A>>(
path: P
) {
return React.useMemo(() => {
@@ -67,7 +67,7 @@ extends Pipeable.Class() implements Form<A, I, R> {
}
useFieldIssuesSubscribable(
path: PropertyPath.Paths<NoInfer<A>>
path: PropertyPath.Paths<A>
) {
return React.useMemo(() => {
const filter = Option.match({