Add Effect v4 support, Fast Refresh tooling, and revamped docs #56
@@ -179,7 +179,7 @@ export const useInput = Effect.fnUntraced(function* <P extends readonly Property
|
|||||||
|
|
||||||
yield* Effect.forkScoped(Effect.all([
|
yield* Effect.forkScoped(Effect.all([
|
||||||
Stream.runForEach(
|
Stream.runForEach(
|
||||||
Stream.drop(form.encodedValue.changes, 1),
|
Stream.drop(Lens.changes(form.encodedValue), 1),
|
||||||
upstreamEncodedValue => Effect.when(
|
upstreamEncodedValue => Effect.when(
|
||||||
Lens.set(internalValueLens, upstreamEncodedValue),
|
Lens.set(internalValueLens, upstreamEncodedValue),
|
||||||
Effect.map(Lens.get(internalValueLens), internalValue => !Equal.equals(upstreamEncodedValue, internalValue)),
|
Effect.map(Lens.get(internalValueLens), internalValue => !Equal.equals(upstreamEncodedValue, internalValue)),
|
||||||
@@ -187,7 +187,7 @@ export const useInput = Effect.fnUntraced(function* <P extends readonly Property
|
|||||||
),
|
),
|
||||||
|
|
||||||
Stream.runForEach(
|
Stream.runForEach(
|
||||||
internalValueLens.changes.pipe(
|
Lens.changes(internalValueLens).pipe(
|
||||||
Stream.drop(1),
|
Stream.drop(1),
|
||||||
Stream.changesWith(Equal.asEquivalence()),
|
Stream.changesWith(Equal.asEquivalence()),
|
||||||
options?.debounce ? Stream.debounce(options.debounce) : identity,
|
options?.debounce ? Stream.debounce(options.debounce) : identity,
|
||||||
@@ -235,7 +235,7 @@ export const useOptionalInput = Effect.fnUntraced(function* <P extends readonly
|
|||||||
|
|
||||||
yield* Effect.forkScoped(Effect.all([
|
yield* Effect.forkScoped(Effect.all([
|
||||||
Stream.runForEach(
|
Stream.runForEach(
|
||||||
Stream.drop(field.encodedValue.changes, 1),
|
Stream.drop(Lens.changes(field.encodedValue), 1),
|
||||||
|
|
||||||
upstreamEncodedValue => Effect.when(
|
upstreamEncodedValue => Effect.when(
|
||||||
Option.match(upstreamEncodedValue, {
|
Option.match(upstreamEncodedValue, {
|
||||||
@@ -257,7 +257,7 @@ export const useOptionalInput = Effect.fnUntraced(function* <P extends readonly
|
|||||||
),
|
),
|
||||||
|
|
||||||
Stream.runForEach(
|
Stream.runForEach(
|
||||||
enabledLens.changes.pipe(
|
Lens.changes(enabledLens).pipe(
|
||||||
Stream.zipLatest(internalValueLens.changes),
|
Stream.zipLatest(internalValueLens.changes),
|
||||||
Stream.drop(1),
|
Stream.drop(1),
|
||||||
Stream.changesWith(Equal.asEquivalence()),
|
Stream.changesWith(Equal.asEquivalence()),
|
||||||
|
|||||||
Reference in New Issue
Block a user