0.2.0 #5
@@ -82,7 +82,7 @@ extends Pipeable.Class() implements Lens<A, ER, EW, RR, RW> {
|
|||||||
readonly [LensTypeId]: LensTypeId = LensTypeId
|
readonly [LensTypeId]: LensTypeId = LensTypeId
|
||||||
readonly [LensImplTypeId]: LensImplTypeId = LensImplTypeId
|
readonly [LensImplTypeId]: LensImplTypeId = LensImplTypeId
|
||||||
|
|
||||||
readonly steps: readonly LensStep<A, B, ER, EW, RR, RW, SourceER, SourceEW, SourceRR, SourceRW>[] = []
|
readonly steps: readonly LensStep<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown>[] = []
|
||||||
|
|
||||||
abstract readonly sourceGet: Effect.Effect<B, SourceER, SourceRR>
|
abstract readonly sourceGet: Effect.Effect<B, SourceER, SourceRR>
|
||||||
abstract readonly sourceChanges: Stream.Stream<B, SourceER, SourceRR>
|
abstract readonly sourceChanges: Stream.Stream<B, SourceER, SourceRR>
|
||||||
@@ -92,14 +92,14 @@ extends Pipeable.Class() implements Lens<A, ER, EW, RR, RW> {
|
|||||||
get get(): Effect.Effect<A, ER, RR> {
|
get get(): Effect.Effect<A, ER, RR> {
|
||||||
let effect: Effect.Effect<unknown, unknown, unknown> = this.sourceGet
|
let effect: Effect.Effect<unknown, unknown, unknown> = this.sourceGet
|
||||||
for (const step of this.steps)
|
for (const step of this.steps)
|
||||||
effect = step.transform(effect as never)
|
effect = step.transform(effect)
|
||||||
return effect as Effect.Effect<A, ER, RR>
|
return effect as Effect.Effect<A, ER, RR>
|
||||||
}
|
}
|
||||||
|
|
||||||
get changes(): Stream.Stream<A, ER, RR> {
|
get changes(): Stream.Stream<A, ER, RR> {
|
||||||
let stream: Stream.Stream<unknown, unknown, unknown> = this.sourceChanges
|
let stream: Stream.Stream<unknown, unknown, unknown> = this.sourceChanges
|
||||||
for (const step of this.steps)
|
for (const step of this.steps)
|
||||||
stream = step.transformStream(stream as never)
|
stream = step.transformStream(stream)
|
||||||
return stream as Stream.Stream<A, ER, RR>
|
return stream as Stream.Stream<A, ER, RR>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ extends Pipeable.Class() implements Lens<A, ER, EW, RR, RW> {
|
|||||||
for (const step of this.steps)
|
for (const step of this.steps)
|
||||||
current = Effect.flatMap(current, parent => {
|
current = Effect.flatMap(current, parent => {
|
||||||
parents.push(parent)
|
parents.push(parent)
|
||||||
return step.transform(Effect.succeed(parent) as never)
|
return step.transform(Effect.succeed(parent))
|
||||||
})
|
})
|
||||||
|
|
||||||
return Effect.flatMap(current, a => Effect.flatMap(
|
return Effect.flatMap(current, a => Effect.flatMap(
|
||||||
@@ -128,7 +128,7 @@ extends Pipeable.Class() implements Lens<A, ER, EW, RR, RW> {
|
|||||||
const step = this.steps[i]!
|
const step = this.steps[i]!
|
||||||
// biome-ignore lint/style/noNonNullAssertion: won't throw
|
// biome-ignore lint/style/noNonNullAssertion: won't throw
|
||||||
const parent = parents[i]!
|
const parent = parents[i]!
|
||||||
rebuilt = step.update(rebuilt as never, parent as never)
|
rebuilt = step.update(rebuilt, parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
return Effect.as(
|
return Effect.as(
|
||||||
|
|||||||
Reference in New Issue
Block a user