Davide Giuseppe Farella
11/05/2022, 11:51 AMplayerFlow.map { player ->
val firstNameLens = Player.name.first
firstNameLens.set(player, "John")
}
If I want to modify also the last name, is there a nicer way than this?
playerFlow.map { player ->
val firstNameLens = Player.name.first
val lastNameLens = Player.name.last
val a = firstNameLens.set(player, "John")
lastNameLens.set(a, "Doe")
}
Davide Giuseppe Farella
11/06/2022, 7:59 AMlet
player
.let { fnLens.set(it, "John") }
.let { lnLens.set(it, "Doe") }
Wilerson Oliveira
11/07/2022, 7:00 AMplayer.copy {
Player.name.first set "John"
Player.name.last set "Doe"
}
Davide Giuseppe Farella
11/07/2022, 7:01 AM