Has anyone managed to get the Paging library to wo...
# multiplatform
p
Has anyone managed to get the Paging library to work fully with Room alpha and Compose multiplatform? Room paging is still Android only so a custom
PagingSource
using limit/offset queries was needed. Initially tried to use Paging 3.3.2 with Cash App lib for Compose, but that was crashing on iOS, but Cash App common lib fixed that and it's working on both platforms. The one issue I have left is that the data invalidation stuff is still Android only, so it seems like I'll need to add something custom to handle this.
Quick hacky solution in the
PagingSource
that seems to work:
Copy code
init {
        CoroutineScope(Dispatchers.IO).launch {
            dao.getCountAsFlow()
                .drop(1)
                .collect {
                    invalidate()
                    cancel()
                }
        }
    }