Hey, I used to have a scroll listener to recycler ...
# compose
r
Hey, I used to have a scroll listener to recycler view to know when I reached the end of the list so I could get data for the next page (pagination). how can I achieve the same in compose?
d
LazyListState
lets you subscribe to what items are visible on the screen. But I (personally) suggest using the Paging 3 Library and offload all that complexity to it.
r
will check that..thanks
s
Paging3 still has integration with RecyclerView but not compose LazyColumn right? So in that case you say to use RV with compose for the individual items, is that correct Eric?
d
Paging 3 has compatibility with Compose, it’s in the docs.
Copy code
// optional - Jetpack Compose integration
  implementation("androidx.paging:paging-compose:3.3.0-alpha02")
s
Right, but does this also take care of dispatching requests of more pages as you are reaching the edges and so on? If yes I had no idea 😲
👌 1