private fun nimbusBranchesFragmentStateReducer( state: NimbusBranchesState, action: NimbusBranchesAction, ): NimbusBranchesState { return when (action) { is NimbusBranchesAction.UpdateBranches -> { state.copy( branches = action.branches, selectedBranch = action.selectedBranch, isLoading = false, ) } is NimbusBranchesAction.UpdateSelectedBranch -> { state.copy(selectedBranch = action.selectedBranch) } is NimbusBranchesAction.UpdateUnselectBranch -> { state.copy(selectedBranch = "") } } }
Reduces the Nimbus branches state from the current state with the provided [action] to be performed.