This might not be the right place to post this question, sorry!
But if I have an object pointed to by lens, e.g.:
const objA: A = {
aVal: "a value"
b: {
bVal: "b value"
}
}
const bLens = Optic.id<A>().at("b")
How could I add a new value "anotherBVal" to b using optics?
I would like the resulting object to be:
objA: {
aVal: "a value",
b: {
bVal: "b value",
anotherBVal: "another b value",
}
}
Is this possible?
This might not be the right place to post this question, sorry!
But if I have an object pointed to by lens, e.g.:
How could I add a new value
"anotherBVal"tobusing optics?I would like the resulting object to be:
Is this possible?