Djaka Pradana Jaya Priambudi
10/03/2022, 10:41 AMsearch
I see in all of your presentation that you guys declared inside the composable like this:
@Composable
fun present(event: Flow<Foo>) {
var search by remember { mutableStateOf(") }
...
}
Why do this? Won't this make it hard to split the code into smaller chank?
Suppose we have lot of events that modify search
like
CollectEffect(event) {
when (it) {
Event A -> search = it.query
Event B -> {
saveToRecentSearch()
search = ""
}
Event C -> ...
}
}
We can't extract event B into a completly different function because search
is inside the present
function
I'm a bit confused about this, thank you