Paul Woitaschek
04/12/2019, 8:21 AMprivate inline fun updateRegistrationState(update : RegistrationState.()->RegistrationState){
registrationState = update(registrationState)
}
I would like to call it as:
updateRegistrationState { gender = Gender.MALE }
instead of updateRegistrationState { copy(gender = Gender.MALE) }
gildor
04/12/2019, 8:21 AMspand
04/12/2019, 8:42 AMRegistrationState
mutable ? ie:
private inline fun updateRegistrationState(update : RegistrationState.()->RegistrationState){
registrationState = registrationState.copy().update()
}
Paul Woitaschek
04/12/2019, 8:53 AMspand
04/12/2019, 8:55 AMRegistrationState
elsewhere then maybe have a MutableRegistrationState : RegistrationState
only for use in the builder ?efemoney
04/12/2019, 11:50 PM