https://kotlinlang.org logo
#arrow
Title
# arrow
d

dimsuz

10/17/2023, 12:26 PM
Hi! Optics related question. Can't figure out if this can be further simplified, the part where filtering by id happens, can this be done with optics too? Optionals?
Copy code
State.screens.every(Every.list()).modify(state) { screen ->
  if (State.currentScreen.id.getOrNull(state) == screen.id) {
    Screen.views.set(screen, views)
  } else screen
}