@@ -155,10 +155,17 @@ export const mapStructAt: {
|
||||
))
|
||||
|
||||
export const mapArrayAt: {
|
||||
<A, ER, EW, RR, RW>(
|
||||
self: Lens<A[], ER, EW, RR, RW>,
|
||||
index: number,
|
||||
): Lens<A, ER | NoSuchElementException, EW | NoSuchElementException, RR, RW>
|
||||
<A, ER, EW, RR, RW>(
|
||||
self: Lens<readonly A[], ER, EW, RR, RW>,
|
||||
index: number,
|
||||
): Lens<A, ER | NoSuchElementException, EW | NoSuchElementException, RR, RW>
|
||||
<A, ER, EW, RR, RW>(
|
||||
index: number
|
||||
): (self: Lens<A[], ER, EW, RR, RW>) => Lens<A, ER | NoSuchElementException, EW | NoSuchElementException, RR, RW>
|
||||
<A, ER, EW, RR, RW>(
|
||||
index: number
|
||||
): (self: Lens<readonly A[], ER, EW, RR, RW>) => Lens<A, ER | NoSuchElementException, EW | NoSuchElementException, RR, RW>
|
||||
@@ -289,8 +296,8 @@ export const updateAndGetEffect: {
|
||||
|
||||
Effect.gen(function*() {
|
||||
const ref = yield* SubscriptionRef.make({
|
||||
values: [13, 69, 1488]
|
||||
})
|
||||
values: [13, 69, 1488] as readonly number[]
|
||||
} as const)
|
||||
|
||||
const myValueLens = ref.pipe(
|
||||
fromSubscriptionRef,
|
||||
@@ -298,6 +305,8 @@ Effect.gen(function*() {
|
||||
mapArrayAt(1),
|
||||
)
|
||||
|
||||
const myValueLens2 = mapArrayAt(mapStructAt(fromSubscriptionRef(ref), "values"), 1)
|
||||
|
||||
console.log(yield* ref.get, yield* myValueLens.get)
|
||||
yield* set(myValueLens, 22)
|
||||
console.log(yield* ref.get, yield* myValueLens.get)
|
||||
|
||||
Reference in New Issue
Block a user