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