Factory
class Factory<T : RealmModel, R : Any>(realmQueryBuilder: RealmQueryBuilder<T>, transform: RealmModelTransform<T, R>) : DataSource.Factory<Int, R>
Content copied to clipboard
DataSource.Factory implementation to construct RealmTiledDataSource
Parameters
realmQueryBuilder
The builder function that will be used to construct RealmQuery instance. Will be called on loading thread.
transform
The transformation function that will be used to map live managed RealmModel instances to type R
. The R
should be unmanaged RealmModel objects or custom types. If managed instances are returned, then thread safety is not guaranteed.
Constructors
Factory
Link copied to clipboard
fun Factory(realmQueryBuilder: RealmQueryBuilder<T>, transform: RealmModelTransform<T, R>)
Content copied to clipboard
The builder function that will be used to construct RealmQuery instance.
Functions
asPagingSourceFactory
Link copied to clipboard
fun asPagingSourceFactory(fetchDispatcher: CoroutineDispatcher): () -> PagingSource<Int, R>
Content copied to clipboard
create
Link copied to clipboard
mapByPage
Link copied to clipboard