private fun recentlyClosedStateReducer( state: RecentlyClosedFragmentState, action: RecentlyClosedFragmentAction, ): RecentlyClosedFragmentState { return when (action) { is RecentlyClosedFragmentAction.Change -> state.copy(items = action.list) is RecentlyClosedFragmentAction.Select -> { state.copy(selectedTabs = state.selectedTabs + action.tab) } is RecentlyClosedFragmentAction.Deselect -> { state.copy(selectedTabs = state.selectedTabs - action.tab) } RecentlyClosedFragmentAction.DeselectAll -> state.copy(selectedTabs = emptySet()) } }
recently closed ui component which keeps the track of the UI state