private fun autofillFragmentStateReducer( state: AutofillFragmentState, action: AutofillAction, ): AutofillFragmentState { return when (action) { is AutofillAction.UpdateAddresses -> { state.copy( addresses = action.addresses, isLoading = false, ) } is AutofillAction.UpdateCreditCards -> { state.copy( creditCards = action.creditCards, isLoading = false, ) } } }
Reduces the autofill state from the current state with the provided [action] to be performed.