mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 05:27:28 +01:00
HistoryScreen: Remove paging (#8125)
* HistoryScreen: Remove paging Per my testing performance-wise there's virtually no difference in loading time. * cleanups * add key and contentType
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
package eu.kanade.domain.history.interactor
|
||||
|
||||
import androidx.paging.Pager
|
||||
import androidx.paging.PagingConfig
|
||||
import androidx.paging.PagingData
|
||||
import eu.kanade.domain.history.model.HistoryWithRelations
|
||||
import eu.kanade.domain.history.repository.HistoryRepository
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -10,12 +7,7 @@ import kotlinx.coroutines.flow.Flow
|
||||
class GetHistory(
|
||||
private val repository: HistoryRepository,
|
||||
) {
|
||||
|
||||
fun subscribe(query: String): Flow<PagingData<HistoryWithRelations>> {
|
||||
return Pager(
|
||||
PagingConfig(pageSize = 25),
|
||||
) {
|
||||
repository.getHistory(query)
|
||||
}.flow
|
||||
fun subscribe(query: String): Flow<List<HistoryWithRelations>> {
|
||||
return repository.getHistory(query)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package eu.kanade.domain.history.repository
|
||||
|
||||
import androidx.paging.PagingSource
|
||||
import eu.kanade.domain.chapter.model.Chapter
|
||||
import eu.kanade.domain.history.model.HistoryUpdate
|
||||
import eu.kanade.domain.history.model.HistoryWithRelations
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface HistoryRepository {
|
||||
|
||||
fun getHistory(query: String): PagingSource<Long, HistoryWithRelations>
|
||||
fun getHistory(query: String): Flow<List<HistoryWithRelations>>
|
||||
|
||||
suspend fun getLastHistory(): HistoryWithRelations?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user