is this not how I would observe the changes in the...
# compose
o
is this not how I would observe the changes in these MutableStateFlows?
Copy code
private val categoryFilter = BrowseEventsFilter.CategoryFilter(category = MutableStateFlow(Category.All))
private val locationFilter = BrowseEventsFilter.LocationFilter(location = MutableStateFlow(null))
private val periodFilter = BrowseEventsFilter.PeriodFilter(
    period = MutableStateFlow(Period.Any),
    dateRange = MutableStateFlow(null)
)
and then you change them
Copy code
var filtersState = MutableStateFlow(listOf(locationFilter, periodFilter, categoryFilter)) // collectAsState in the activity

// how they change
filterState?.enabled?.value = ChipStatus.ENABLED
filterState?.period?.value = period
filterState?.dateRange?.value = null
and then observe them
Copy code
flowOf(periodFilter.period?.value,
    periodFilter.dateRange?.value,
    categoryFilter.category.value,
    locationFilter.location.value
).collect {

// do something everytime their values change
}
f
You are just creating a flow that will emit 4 values and stop. Look at the
flowOf
implementation:
Copy code
public fun <T> flowOf(vararg elements: T): Flow<T> = flow {
    for (element in elements) {
        emit(element)
    }
}
Also not really #compose related
o
oops, wrong channel
c
#flow Btw I think you are looking for
combine
o
ended up with
merge