ursus
03/05/2020, 12:29 AMval newState = state.copy(
items = state.items.map {
if (it.id == id) {
it.copy(
text = newText
)
} else {
it
}
}
)tschuchort
03/05/2020, 10:12 AMtschuchort
03/05/2020, 10:16 AMsetItem: State.(Item) -> State and setId: Item.(Id) -> Item you can compose them to a method setItemId: State.(Id) -> State .ursus
03/05/2020, 11:20 AMitem = item.setId ?tschuchort
03/05/2020, 2:16 PM