There's other option where we can do this if we pu...
# squarelibraries
d
There's other option where we can do this if we put the state declaration in the class level:
Copy code
class Presenter: MoleculePresenter {
  var search by mutableStateOf(")

   @Composable
   fun present(event: Event): State {
      CollectEffect(event) {
         when(event) {
            eventB()
         }
      }

      ...
   }
   
   private fun eventB() {
      saveToRecentSearch(search)
      search = ""
   }
}
But after seeing lot of presentation from cashapp or regarding molecule, none of them are doing this so I'm curious why they didn't do this