miha-x64
04/24/2017, 4:03 PMvar user = state.user
sendToBackend(diff.mapValues { when (it.key) {
"name" -> (it.value as String).also { user = user.copy(name = it) }
"sex" -> ((it.value as Sex).also { user = user.copy(sex = it) }).name
"birth" -> ((it.value as Calendar).also { user = user.copy(birth = it.time) }.timeInMillis / 1000L).toString()
else -> throw AssertionError()
} })
spand
04/24/2017, 6:42 PM