0.2.6 #49
@@ -15,7 +15,7 @@ export interface SynchronizedForm<
|
||||
in out TEW = never,
|
||||
in out TRR = never,
|
||||
in out TRW = never,
|
||||
> extends Form.Form<readonly [], A, I, never, never> {
|
||||
> extends Form.Form<readonly [], A, I, TER, TEW> {
|
||||
readonly [SynchronizedFormTypeId]: SynchronizedFormTypeId
|
||||
|
||||
readonly schema: Schema.Schema<A, I, R>
|
||||
@@ -41,7 +41,7 @@ export class SynchronizedFormImpl<
|
||||
readonly path = [] as const
|
||||
|
||||
readonly value: Subscribable.Subscribable<Option.Option<A>, never, never>
|
||||
readonly encodedValue: Lens.Lens<I, never, never, never, never>
|
||||
readonly encodedValue: Lens.Lens<I, TER, TEW, never, never>
|
||||
readonly isValidating: Subscribable.Subscribable<boolean, never, never>
|
||||
readonly canCommit: Subscribable.Subscribable<boolean, never, never>
|
||||
|
||||
@@ -75,7 +75,7 @@ export class SynchronizedFormImpl<
|
||||
Subscribable.unwrap,
|
||||
)
|
||||
this.encodedValue = Effect.succeed(this).pipe(
|
||||
Effect.map(self => Lens.make<I, never, never, never, never>({
|
||||
Effect.map(self => Lens.make<I, TER, TEW, never, never>({
|
||||
get get() { return self.internalEncodedValue.get },
|
||||
get changes() { return self.internalEncodedValue.changes },
|
||||
modify: f => self.internalEncodedValue.modify(
|
||||
@@ -87,12 +87,7 @@ export class SynchronizedFormImpl<
|
||||
] as const,
|
||||
)
|
||||
).pipe(
|
||||
Effect.tap(([, nextEncodedValue]) =>
|
||||
self.synchronizeEncodedValue(nextEncodedValue).pipe(
|
||||
Effect.forkScoped,
|
||||
Effect.provide(self.context),
|
||||
)
|
||||
),
|
||||
Effect.tap(([, nextEncodedValue]) => self.synchronizeEncodedValue(nextEncodedValue)),
|
||||
Effect.map(([b]) => b),
|
||||
),
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user