Google is committed to advancing racial equity for Black communities. See how.

InvalidatingPagingSourceFactory

open class InvalidatingPagingSourceFactory<Key : Any, Value : Any> : () -> PagingSource<Key, Value>
kotlin.Any
   ↳ androidx.paging.InvalidatingPagingSourceFactory

Abstract wrapper class for PagingSource factory intended for usage in Pager construction. Stores reference to the PagingSource factory and the PagingSources it produces for invalidation when the backing dataset is updated.

Calling invalidate on this InvalidatingPagingSourceFactory will automatically forward invalidate signals to all active PagingSources.

Summary

Public constructors
<init>(pagingSourceFactory: () -> PagingSource<Key, Value>)

Abstract wrapper class for PagingSource factory intended for usage in Pager construction.

Public methods
Unit

Calls PagingSource.invalidate on each PagingSource that was produced by this InvalidatingPagingSourceFactory

PagingSource<Key, Value>

Inherited extension functions
From androidx.paging.kotlin.Function0
Flowable<PagedList<Value>>
() -> PagingSource<Key, Value>.toFlowable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

Constructs a Flowable<PagedList>, from this PagingSource factory, convenience for RxPagedListBuilder.

Flowable<PagedList<Value>>
() -> PagingSource<Key, Value>.toFlowable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

Constructs a Flowable<PagedList>, from this PagingSource factory, convenience for RxPagedListBuilder.

LiveData<PagedList<Value>>
() -> PagingSource<Key, Value>.toLiveData(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, coroutineScope: CoroutineScope = GlobalScope, fetchDispatcher: CoroutineDispatcher = ArchTaskExecutor.getIOThreadExecutor() .asCoroutineDispatcher())

Constructs a LiveData<PagedList>, from this PagingSource factory, convenience for LivePagedListBuilder.

LiveData<PagedList<Value>>
() -> PagingSource<Key, Value>.toLiveData(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, coroutineScope: CoroutineScope = GlobalScope, fetchDispatcher: CoroutineDispatcher = ArchTaskExecutor.getIOThreadExecutor() .asCoroutineDispatcher())

Constructs a LiveData<PagedList>, from this PagingSource factory, convenience for LivePagedListBuilder.

Observable<PagedList<Value>>
() -> PagingSource<Key, Value>.toObservable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

Constructs a Observable<PagedList> from this PagingSource factory, convenience for RxPagedListBuilder.

Observable<PagedList<Value>>
() -> PagingSource<Key, Value>.toObservable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

Constructs a Observable<PagedList> from this PagingSource factory, convenience for RxPagedListBuilder.

Public constructors

<init>

InvalidatingPagingSourceFactory(pagingSourceFactory: () -> PagingSource<Key, Value>)

Abstract wrapper class for PagingSource factory intended for usage in Pager construction. Stores reference to the PagingSource factory and the PagingSources it produces for invalidation when the backing dataset is updated.

Calling invalidate on this InvalidatingPagingSourceFactory will automatically forward invalidate signals to all active PagingSources.

Parameters
pagingSourceFactory: () -> PagingSource<Key, Value> The PagingSource factory that returns a PagingSource when called

Public methods

invalidate

fun invalidate(): Unit

Calls PagingSource.invalidate on each PagingSource that was produced by this InvalidatingPagingSourceFactory

invoke

fun invoke(): PagingSource<Key, Value>
Return
PagingSource which will be invalidated when this factory's invalidate method is called