private fun accountStateReducer( state: AccountSettingsFragmentState, action: AccountSettingsFragmentAction, ): AccountSettingsFragmentState { return when (action) { is AccountSettingsFragmentAction.SyncFailed -> state.copy(lastSyncedDate = LastSyncTime.Failed(action.time)) is AccountSettingsFragmentAction.SyncEnded -> state.copy(lastSyncedDate = LastSyncTime.Success(action.time)) is AccountSettingsFragmentAction.UpdateDeviceName -> state.copy(deviceName = action.name) } }
The SearchState Reducer.