RxRemoteMediator

@ExperimentalPagingApi public abstract class RxRemoteMediator<Key extends Object, Value extends Object> extends RemoteMediator

Object
   ↳ RemoteMediator
     ↳ RxRemoteMediator

RxJava2 compatibility wrapper around RemoteMediator's suspending APIs.

Summary

Public constructors

<Key extends Object, Value extends Object> RxRemoteMediator()

Public methods

final @NonNull RemoteMediator.InitializeAction

Callback fired during initialization of a PagingData stream, before initial load.

@NonNull Single<@NonNull RemoteMediator.InitializeAction>

Callback fired during initialization of a PagingData stream, before initial load.

final @NonNull RemoteMediator.MediatorResult
load(LoadType loadType, PagingState<Key, Value> state)

Callback triggered when Paging needs to request more data from a remote source due to any of the following events:

abstract @NonNull Single<@NonNull RemoteMediator.MediatorResult>
loadSingle(LoadType loadType, PagingState<Key, Value> state)

Implement this method to load additional remote data, which will then be stored for the PagingSource to access.

Public constructors

RxRemoteMediator

public final <Key extends Object, Value extends Object> RxRemoteMediator()

Public methods

initialize

public final @NonNull RemoteMediator.InitializeAction initialize()

Callback fired during initialization of a PagingData stream, before initial load.

This function runs to completion before any loading is performed.

Returns
@NonNull RemoteMediator.InitializeAction

InitializeAction used to control whether load with load type REFRESH will be immediately dispatched when the first PagingData is submitted: