Cleanup
All checks were successful
Lint / lint (push) Successful in 14s

This commit is contained in:
Julien Valverdé
2026-03-24 10:20:54 +01:00
parent 34b9452c1c
commit f08cc59fef

View File

@@ -1,4 +1,4 @@
import { Array, Chunk, Effect, Function, Pipeable, Predicate, Readable, Stream, Subscribable, SubscriptionRef } from "effect"
import { Array, Chunk, Effect, Function, Pipeable, Predicate, Readable, Stream, Subscribable, type SubscriptionRef } from "effect"
import type { NoSuchElementException } from "effect/Cause"
@@ -139,7 +139,7 @@ export const mapEffect: {
)),
}))
export const mapStructField: {
export const mapField: {
<A extends object, K extends keyof A, ER, EW, RR, RW>(
self: Lens<A, ER, EW, RR, RW>,
key: K,
@@ -287,24 +287,3 @@ export const updateAndGetEffect: {
next => Effect.succeed([next, next] as const),
)),
)
Effect.gen(function*() {
const ref = yield* SubscriptionRef.make({
values: [13, 69, 1488] as readonly number[]
} as const)
const myValueLens = ref.pipe(
fromSubscriptionRef,
mapStructField("values"),
mapArrayAt(1),
)
const myValueLens2 = mapArrayAt(mapStructField(fromSubscriptionRef(ref), "values"), 1)
console.log(yield* ref.get, yield* myValueLens.get)
yield* set(myValueLens, 22)
console.log(yield* ref.get, yield* myValueLens.get)
}).pipe(
Effect.runSync
)