Hi I have a question regarding how you guys use mo...
# squarelibraries
d
Hi I have a question regarding how you guys use molecule Suppose you have a interactable state (can be changed by user inputs)
search
I see in all of your presentation that you guys declared inside the composable like this:
Copy code
@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
Copy code
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