# DataSource.Factory

Artifact: [androidx.paging:paging-common](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/DataSource.jvmAndAndroid.kt+class:androidx.paging.DataSource.Factory) Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)

*** ** * ** ***


```
public abstract class DataSource.Factory<Key extends Object, Value extends Object>
```

<br />

*** ** * ** ***

Factory for DataSources.

Data-loading systems of an application or library can implement this interface to allow `LiveData<PagedList>`s to be created. For example, Room can provide a `https://developer.android.com/reference/androidx/paging/DataSource.Factory` for a given SQL query:

```
@Dao
interface UserDao {
    @Query("SELECT * FROM user ORDER BY lastName ASC")
    public abstract DataSource.Factory<Integer, User> usersByLastName();
}
```

In the above sample, `Integer` is used because it is the `Key` type of PositionalDataSource. Currently, Room uses the `LIMIT`/`OFFSET` SQL keywords to page a large query with a PositionalDataSource.

| Parameters |
|---|---|
| `<Key extends https://developer.android.com/reference/java/lang/Object.html>` | Key identifying items in DataSource. |
| `<Value extends https://developer.android.com/reference/java/lang/Object.html>` | Type of items in the list loaded by the DataSources. |

## Summary

| ### Public constructors |
|---|
| `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/DataSource.Factory#Factory()()` |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull Function0<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `https://developer.android.com/reference/androidx/paging/DataSource.Factory#asPagingSourceFactory(kotlinx.coroutines.CoroutineDispatcher)(@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html fetchDispatcher)` |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value>` | `https://developer.android.com/reference/androidx/paging/DataSource.Factory#create()()` Create a `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull ToValue>` | `<ToValue extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/DataSource.Factory#map(androidx.arch.core.util.Function)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/arch/core/util/Function<@https://developer.android.com/reference/androidx/annotation/NonNull Value, @https://developer.android.com/reference/androidx/annotation/NonNull ToValue> function )` Applies the given function to each value emitted by DataSources produced by this Factory. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull ToValue>` | `<ToValue extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/DataSource.Factory#mapByPage(androidx.arch.core.util.Function)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/arch/core/util/Function<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull Value>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull ToValue>> function )` Applies the given function to each value emitted by DataSources produced by this Factory. |

| ### Extension functions |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/LiveData<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/LivePagedListKt.[toLiveData](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html fetchExecutor )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/LiveData<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/LivePagedListKt.[toLiveData](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, int pageSize, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html fetchExecutor )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler, @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html backpressureStrategy )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler, @https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html backpressureStrategy )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, int pageSize, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler, @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html backpressureStrategy )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, int pageSize, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler, @https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html backpressureStrategy )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, int pageSize, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler, http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver, int pageSize, Key initialLoadKey, https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler, https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |

## Public constructors

### Factory

```
public <Key extends Object, Value extends Object> Factory()
```

| Parameters |
|---|---|
| `<Key extends https://developer.android.com/reference/java/lang/Object.html>` | Key identifying items in DataSource. |
| `<Value extends https://developer.android.com/reference/java/lang/Object.html>` | Type of items in the list loaded by the DataSources. |

## Public methods

### asPagingSourceFactory

Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
public final @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> asPagingSourceFactory(@NonNull CoroutineDispatcher fetchDispatcher)
```

### create

Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)

```
public abstract @NonNull DataSource<@NonNull Key, @NonNull Value> create()
```

Create a `https://developer.android.com/reference/androidx/paging/DataSource`.

The `https://developer.android.com/reference/androidx/paging/DataSource` should invalidate itself if the snapshot is no longer valid. If a `https://developer.android.com/reference/androidx/paging/DataSource` becomes invalid, the only way to query more data is to create a new `https://developer.android.com/reference/androidx/paging/DataSource` from the Factory.

`https://developer.android.com/reference/androidx/paging/LivePagedListBuilder` for example will construct a new PagedList and DataSource when the current DataSource is invalidated, and pass the new PagedList through the `LiveData<PagedList>` to observers.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value>` | the new DataSource. |

### map

Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)

```
public @NonNull DataSource.Factory<@NonNull Key, @NonNull ToValue> <ToValue extends Object> map(
    @NonNull Function<@NonNull Value, @NonNull ToValue> function
)
```

Applies the given function to each value emitted by DataSources produced by this Factory.

Same as `https://developer.android.com/reference/androidx/paging/DataSource.Factory#mapByPage(androidx.arch.core.util.Function)`, but operates on individual items.

| Parameters |
|---|---|
| `<ToValue extends https://developer.android.com/reference/java/lang/Object.html>` | Type of items produced by the new `https://developer.android.com/reference/androidx/paging/DataSource`, from the passed function. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/arch/core/util/Function<@https://developer.android.com/reference/androidx/annotation/NonNull Value, @https://developer.android.com/reference/androidx/annotation/NonNull ToValue> function` | Function that runs on each loaded item, returning items of a potentially new type. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull ToValue>` | A new `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, which transforms items using the given function. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/DataSource.Factory#mapByPage(androidx.arch.core.util.Function)` |   |
| `https://developer.android.com/reference/androidx/paging/DataSource#map(androidx.arch.core.util.Function)` |   |
| `https://developer.android.com/reference/androidx/paging/DataSource#mapByPage(androidx.arch.core.util.Function)` |   |

### mapByPage

Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0)

```
public @NonNull DataSource.Factory<@NonNull Key, @NonNull ToValue> <ToValue extends Object> mapByPage(
    @NonNull Function<@NonNull List<@NonNull Value>, @NonNull List<@NonNull ToValue>> function
)
```

Applies the given function to each value emitted by DataSources produced by this Factory.

Same as `https://developer.android.com/reference/androidx/paging/DataSource.Factory#map(androidx.arch.core.util.Function)`, but allows for batch conversions.

| Parameters |
|---|---|
| `<ToValue extends https://developer.android.com/reference/java/lang/Object.html>` | Type of items produced by the new `https://developer.android.com/reference/androidx/paging/DataSource`, from the passed function. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/arch/core/util/Function<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull Value>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull ToValue>> function` | Function that runs on each loaded page, returning items of a potentially new type. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource.Factory<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull ToValue>` | A new `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, which transforms items using the given function. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/DataSource.Factory#map(androidx.arch.core.util.Function)` |   |
| `https://developer.android.com/reference/androidx/paging/DataSource#map(androidx.arch.core.util.Function)` |   |
| `https://developer.android.com/reference/androidx/paging/DataSource#mapByPage(androidx.arch.core.util.Function)` |   |

## Extension functions

### LivePagedListKt.toLiveData

Artifact: [androidx.paging:paging-runtime](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/LivePagedList.kt+function:toLiveData)

```
public final @NonNull LiveData<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> LivePagedListKt.[toLiveData](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull Executor fetchExecutor
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(
>                 config.pageSize,
>                 config.prefetchDistance,
>                 config.enablePlaceholders,
>                 config.initialLoadSizeHint,
>                 config.maxSize
>             ),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchExecutor.asCoroutineDispatcher())
>         ).liveData
> ```

Constructs a `LiveData<PagedList>`, from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/LivePagedListBuilder`.

No work (such as loading) is done immediately, the creation of the first `https://developer.android.com/reference/androidx/paging/PagedList` is deferred until the `https://developer.android.com/reference/androidx/lifecycle/LiveData` is observed.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config` | Paging configuration. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/PagingSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html fetchExecutor` | `https://developer.android.com/reference/java/util/concurrent/Executor.html` for fetching data from `https://developer.android.com/reference/androidx/paging/PagingSource`s. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/LivePagedListBuilder` |   |

### LivePagedListKt.toLiveData

Artifact: [androidx.paging:paging-runtime](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/LivePagedList.kt+function:toLiveData)

```
public final @NonNull LiveData<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> LivePagedListKt.[toLiveData](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    @NonNull Executor fetchExecutor
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(pageSize),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchExecutor.asCoroutineDispatcher())
>         ).liveData
> ```

Constructs a `LiveData<PagedList>`, from this `DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/LivePagedListBuilder`.

No work (such as loading) is done immediately, the creation of the first `https://developer.android.com/reference/androidx/paging/PagedList` is deferred until the `https://developer.android.com/reference/androidx/lifecycle/LiveData` is observed.

| Parameters |
|---|---|
| `int pageSize` | Page size. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/PagingSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html fetchExecutor` | Executor for fetching data from DataSources. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/LivePagedListBuilder` |   |

### RxPagedListKt.toFlowable

Artifact: [androidx.paging:paging-rxjava3](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/rxjava3/RxPagedList.kt+function:toFlowable)

```
public final @NonNull Flowable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler,
    @NonNull BackpressureStrategy backpressureStrategy
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(
>                 config.pageSize,
>                 config.prefetchDistance,
>                 config.enablePlaceholders,
>                 config.initialLoadSizeHint,
>                 config.maxSize
>             ),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).flowable
> ```

Constructs a `Flowable<PagedList>`, from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder`.

The returned `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config` | Paging configuration. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html backpressureStrategy` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html` for the `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` to use. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler)` |   |

### RxPagedListKt.toFlowable

Artifact: [androidx.paging:paging-rxjava2](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/RxPagedList.kt+function:toFlowable)

```
public final @NonNull Flowable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler,
    @NonNull BackpressureStrategy backpressureStrategy
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(
>                 config.pageSize,
>                 config.prefetchDistance,
>                 config.enablePlaceholders,
>                 config.initialLoadSizeHint,
>                 config.maxSize
>             ),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).flowable
> ```

Constructs a `Flowable<PagedList>`, from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder`.

The returned `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config` | Paging configuration. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html backpressureStrategy` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html` for the `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` to use. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler)` |   |

### RxPagedListKt.toFlowable

Artifact: [androidx.paging:paging-rxjava3](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/rxjava3/RxPagedList.kt+function:toFlowable)

```
public final @NonNull Flowable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler,
    @NonNull BackpressureStrategy backpressureStrategy
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(pageSize),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).flowable
> ```

Constructs a `Flowable<PagedList>`, from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder`.

The returned `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `int pageSize` | Page size. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html backpressureStrategy` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html` for the `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` to use. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler)` |   |

### RxPagedListKt.toFlowable

Artifact: [androidx.paging:paging-rxjava2](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/RxPagedList.kt+function:toFlowable)

```
public final @NonNull Flowable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toFlowable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler,
    @NonNull BackpressureStrategy backpressureStrategy
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(pageSize),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).flowable
> ```

Constructs a `Flowable<PagedList>`, from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder`.

The returned `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toFlowable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `int pageSize` | Page size. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html backpressureStrategy` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html` for the `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` to use. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler)` |   |

### RxPagedListKt.toObservable

Artifact: [androidx.paging:paging-rxjava3](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/rxjava3/RxPagedList.kt+function:toObservable)

```
public final @NonNull Observable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(
>                 config.pageSize,
>                 config.prefetchDistance,
>                 config.enablePlaceholders,
>                 config.initialLoadSizeHint,
>                 config.maxSize
>             ),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).observable
> ```

Constructs a `Observable<PagedList>` from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder`.

The returned `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config` | Paging configuration. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to PagedList load state. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy)` |   |

### RxPagedListKt.toObservable

Artifact: [androidx.paging:paging-rxjava2](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/RxPagedList.kt+function:toObservable)

```
public final @NonNull Observable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    @NonNull PagedList.Config config,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(
>                 config.pageSize,
>                 config.prefetchDistance,
>                 config.enablePlaceholders,
>                 config.initialLoadSizeHint,
>                 config.maxSize
>             ),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).observable
> ```

Constructs a `Observable<PagedList>` from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder`.

The returned `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toObservable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config` | Paging configuration. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to PagedList load state. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy)` |   |

### RxPagedListKt.toObservable

Artifact: [androidx.paging:paging-rxjava3](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/rxjava3/RxPagedList.kt+function:toObservable)

```
public final @NonNull Observable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(pageSize),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).observable
> ```

Constructs a `Observable<PagedList>` from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder`.

The returned `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `int pageSize` | Size of pages to load. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html fetchScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html notifyScheduler` | `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/rxjava3/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/rxjava3/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.Scheduler,io.reactivex.rxjava3.core.BackpressureStrategy)` |   |

### RxPagedListKt.toObservable

Artifact: [androidx.paging:paging-rxjava2](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/RxPagedList.kt+function:toObservable)

```
public final @NonNull Observable<@NonNull PagedList<@NonNull Value>> <Key extends Object, Value extends Object> RxPagedListKt.[toObservable](https://developer.android.com/reference/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler))(
    @NonNull DataSource.Factory<@NonNull Key, @NonNull Value> receiver,
    int pageSize,
    Key initialLoadKey,
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback,
    Scheduler fetchScheduler,
    Scheduler notifyScheduler
)
```

> [!CAUTION]
> **This method is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```
> Pager(
>             PagingConfig(pageSize),
>             initialLoadKey,
>             this.asPagingSourceFactory(fetchScheduler?.asCoroutineDispatcher() ?: Dispatchers.IO)
>         ).observable
> ```

Constructs a `Observable<PagedList>` from this `https://developer.android.com/reference/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder`.

The returned `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` will already be subscribed on the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler)`, and will perform all loading on that scheduler. It will already be observed on `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler)`, and will dispatch new `https://developer.android.com/reference/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `int pageSize` | Size of pages to load. |
| `Key initialLoadKey` | Initial load key passed to the first `https://developer.android.com/reference/androidx/paging/PagedList` / `https://developer.android.com/reference/androidx/paging/DataSource`. |
| `https://developer.android.com/reference/androidx/paging/PagedList.BoundaryCallback<@https://developer.android.com/reference/androidx/annotation/NonNull Value> boundaryCallback` | The boundary callback for listening to `https://developer.android.com/reference/androidx/paging/PagedList` load state. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html fetchScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` used to fetch from `https://developer.android.com/reference/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html notifyScheduler` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.paging.DataSource.Factory).toFlowable(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler,io.reactivex.BackpressureStrategy)` |   |