zcash-android-wallet-sdk / cash.z.wallet.sdk.ext.android / androidx.paging.DataSource.Factory

Extensions for androidx.paging.DataSource.Factory

toFlowPagedList

Constructs a Flow<PagedList>, from this DataSource.Factory, convenience for FlowPagedListBuilder.

fun <Key, Value> Factory<Key, Value>.toFlowPagedList(config: Config, initialLoadKey: Key? = null, boundaryCallback: BoundaryCallback<Value>? = null, fetchContext: CoroutineDispatcher = Dispatchers.IO): Flow<PagedList<Value>>
fun <Key, Value> Factory<Key, Value>.toFlowPagedList(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: BoundaryCallback<Value>? = null, fetchContext: CoroutineDispatcher = Dispatchers.IO): Flow<PagedList<Value>>

toRefreshable

Allows another component to call invalidate on the most recently created datasource. Although it is expected that a DataSource will invalidate itself, there are times where external components have modified the underlying data and thereby become responsible for invalidation. In our case, there is more than one process updating the database. So the other process must invalidate the data after an update in order to trigger refreshes all the way up the stack.

fun <Key, Value> Factory<Key, Value>.toRefreshable(): RefreshableDataSourceFactory<Key, Value>