I'm building a Jetpack Compose Deskop app that currently as a draft looks like this:
The 1 and 2 are two ViewModels:
// 1
class FilterViewModel {
val query = mutableStateOf<String?>(null)
val timeframe = mutableStateOf("Any")
}
// 2
class GridViewModel {
val items = mutableListOf("foo", "bar", "baz")
}
I'd like the GridViewModel to update its items when the FilterViewModel changes. How do I do that in this situation? Does Jetpack Compose Deskop have anything to offer here or perhaps there are some more general solutions?

Aucun commentaire:
Enregistrer un commentaire