```private val locationFilter = BrowseEventsFi...
# compose
o
Copy code
private val locationFilter =
    BrowseEventsFilter.LocationFilter(location = MutableStateFlow(null))

private val categoryFilter =
    BrowseEventsFilter.CategoryFilter(category = MutableStateFlow(null))

private val periodFilter = BrowseEventsFilter.PeriodFilter(
    period = MutableStateFlow(Period.Any),
    dateRange = MutableStateFlow(null)
)

val filtersState = MutableStateFlow(
    listOf(
        periodFilter,
        locationFilter,
        categoryFilter
    )
)

viewModelScope.launch(<http://dispatchers.io|dispatchers.io>) {

            filtersState.collect {
and in the activity
Copy code
val filtersState by browseEventsViewModel.filtersState.collectAsState()
is this not enough to guarantee a recomposition if something inside filterState changes?
s
What is the type of the three filters? As far as I can see, the filtersState stays the same object, only some internal state of inside the filters is changing, which has no way to notify the MutableStateFlow that it’s changed. For it to trigger a new emission to be collected the entire object inside needs to change to a new object, not to have internal state change. That’s a Flow thing, nothing to have with compose really.