https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
d

Davide Giuseppe Farella

03/12/2023, 8:47 AM
#Molecule #Paging-compose Hello people, I promised myself to explore Molecule, but never had a chance. I’m integrating Paging in my Compose project, and what I hate most is the fact that your paged items cannot be part of the State, as you need to collect the paged Flow from Compose I was wondering if Molecule can solve this, as I imagine I could do the following:
Copy code
class MyViewModel {

  val state = launchModulecule {
    val lazyPagingItems = pagedFlow.collectAsLazyPagingItems()
    MyState(
      items = lazyPagingItems,
      stuff = someStuff
    )
  }
}
Is this correct?
8 Views