@@ -122,16 +122,13 @@ extends Pipeable.Class() implements Form<A, I, R> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const make = <A, I = A, R = never>(
|
export const make: {
|
||||||
options: make.Options<A, I, R>
|
<A, I = A, R = never>(options: make.Options<A, I, R>): Effect.Effect<Form<A, I, R>>
|
||||||
): Effect.Effect<Form<A, I, R>> => Effect.gen(function*() {
|
} = Effect.fnUntraced(function* <A, I = A, R = never>(options: make.Options<A, I, R>) {
|
||||||
const latestValueRef = yield* SubscriptionRef.make(options.initialValue)
|
|
||||||
const errorRef = yield* SubscriptionRef.make(Option.none<ParseResult.ParseError>())
|
|
||||||
|
|
||||||
return new FormImpl(
|
return new FormImpl(
|
||||||
options.schema,
|
options.schema,
|
||||||
latestValueRef,
|
yield* SubscriptionRef.make(options.initialValue),
|
||||||
errorRef,
|
yield* SubscriptionRef.make(Option.none<ParseResult.ParseError>()),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user