Android 12 Developer Preview is here! Try it out, and give us your feedback!

InvalidatingPagingSourceFactory

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

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>)

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,