Join Slack
Powered by
Does Optics have a shortcut to modify a value usi...
# arrow
d
dave08
02/28/2023, 1:43 PM
Does Optics have a shortcut to modify a value using the object itself (or similar to kotlin's generated copy)?
w
Wilerson Oliveira
02/28/2023, 1:58 PM
Copy code
myObject.copy { MyClass.attribute1.transform { "$it-transformed" } }
d
dave08
02/28/2023, 2:08 PM
I just discovered that there's also an infix
set
! Thanks!
dave08
02/28/2023, 2:09 PM
I wonder what the difference is..
dave08
02/28/2023, 2:10 PM
Oh... it's to get the old value and transform it, nice!
2
Views
Open in Slack
Previous
Next