UsersRemoteMediator

class UsersRemoteMediator(apiService: UsersApiService, dataService: UsersDataService, preferences: UsersPreferences) : RemoteMediator<Int, UserModel>

Paging list with room cache RemoteMediator

Author

Vitaliy Zarubin

See also

Parameters

apiService

query service module

dataService

service room db

preferences

service shared preferences

Constructors

UsersRemoteMediator
Link copied to clipboard
fun UsersRemoteMediator(apiService: UsersApiService, dataService: UsersDataService, preferences: UsersPreferences)

Types

Companion
Link copied to clipboard
object Companion

Static key for offset-limit paging

Functions

initialize
Link copied to clipboard
open suspend override fun initialize(): RemoteMediator.InitializeAction

Timeout cache for refresh list at start

load
Link copied to clipboard
open suspend override fun load(loadType: LoadType, state: PagingState<Int, UserModel>): RemoteMediator.MediatorResult

Base logic

Properties

apiService
Link copied to clipboard
private val apiService: UsersApiService
dataService
Link copied to clipboard
private val dataService: UsersDataService
preferences
Link copied to clipboard
private val preferences: UsersPreferences