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

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- android

  ```
  abstract class DataSource.Factory<Key : Any, Value : Any>
  ```

*** ** * ** ***

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/kotlin/androidx/paging/DataSource.Factory` for a given SQL query:

```kotlin
@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 : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Key identifying items in DataSource. |
| `<Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items in the list loaded by the DataSources. |

## Summary

| ### Public constructors |
|---|---|
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#Factory()()` | android |

| ### Public functions |
|---|---|---|
| `() -> https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#asPagingSourceFactory(kotlinx.coroutines.CoroutineDispatcher)(fetchDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html)` | android |
| `abstract https://developer.android.com/reference/kotlin/androidx/paging/DataSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#create()()` Create a `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`. | android |
| `open https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, ToValue>` | `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#map(androidx.arch.core.util.Function)(function: https://developer.android.com/reference/kotlin/androidx/arch/core/util/Function<Value, ToValue>)` Applies the given function to each value emitted by DataSources produced by this Factory. | android |
| `open https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, ToValue>` | `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#map(kotlin.Function1)(function: (Value) -> ToValue)` Applies the given function to each value emitted by DataSources produced by this Factory. | android |
| `open https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, ToValue>` | `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#mapByPage(androidx.arch.core.util.Function)(function: https://developer.android.com/reference/kotlin/androidx/arch/core/util/Function<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<Value>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<ToValue>>)` Applies the given function to each value emitted by DataSources produced by this Factory. | android |
| `open https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, ToValue>` | `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#mapByPage(kotlin.Function1)(function: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<Value>) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<ToValue>)` Applies the given function to each value emitted by DataSources produced by this Factory. | android |

| ### Extension functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/lifecycle/LiveData<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toLiveData](https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))( config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/lifecycle/LiveData<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toLiveData](https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))( pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))( config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: 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?, backpressureStrategy: http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))( config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html?, notifyScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html?, backpressureStrategy: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))( pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: 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?, backpressureStrategy: http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/BackpressureStrategy.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))( pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html?, notifyScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html?, backpressureStrategy: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/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))( config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: 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? )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/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))( config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html?, notifyScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html? )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/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))( pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: 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? )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler))( pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialLoadKey: Key?, boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?, fetchScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html?, notifyScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html? )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |

## Public constructors

### Factory

android

```
<Key : Any, Value : Any> Factory()
```

| Parameters |
|---|---|
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Key identifying items in DataSource. |
| `<Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items in the list loaded by the DataSources. |

## Public functions

### asPagingSourceFactory

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

```
fun asPagingSourceFactory(
    fetchDispatcher: CoroutineDispatcher = Dispatchers.IO
): () -> PagingSource<Key, Value>
```

### create

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

```
abstract fun create(): DataSource<Key, Value>
```

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

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

`https://developer.android.com/reference/kotlin/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/kotlin/androidx/paging/DataSource<Key, Value>` | the new DataSource. |

### map

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

```
open fun <ToValue : Any> map(function: Function<Value, ToValue>): DataSource.Factory<Key, ToValue>
```

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

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

| Parameters |
|---|---|
| `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items produced by the new `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`, from the passed function. |
| `function: https://developer.android.com/reference/kotlin/androidx/arch/core/util/Function<Value, ToValue>` | Function that runs on each loaded item, returning items of a potentially new type. |

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

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

### map

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

```
open fun <ToValue : Any> map(function: (Value) -> ToValue): DataSource.Factory<Key, ToValue>
```

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

An overload of `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#map(kotlin.Function1)` that accepts a kotlin function type.

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

| Parameters |
|---|---|
| `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items produced by the new `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`, from the passed function. |
| `function: (Value) -> ToValue` | Function that runs on each loaded item, returning items of a potentially new type. |

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

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

### mapByPage

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

```
open fun <ToValue : Any> mapByPage(function: Function<List<Value>, List<ToValue>>): DataSource.Factory<Key, ToValue>
```

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

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

| Parameters |
|---|---|
| `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items produced by the new `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`, from the passed function. |
| `function: https://developer.android.com/reference/kotlin/androidx/arch/core/util/Function<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<Value>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<ToValue>>` | Function that runs on each loaded page, returning items of a potentially new type. |

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

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

### mapByPage

android

```
open fun <ToValue : Any> mapByPage(function: (List<Value>) -> List<ToValue>): DataSource.Factory<Key, ToValue>
```

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

An overload of `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#mapByPage(kotlin.Function1)` that accepts a kotlin function type.

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

| Parameters |
|---|---|
| `<ToValue : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items produced by the new `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`, from the passed function. |
| `function: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<Value>) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<ToValue>` | Function that runs on each loaded page, returning items of a potentially new type. |

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

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

## Extension functions

### DataSource.Factory.toLiveData

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toLiveData](https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(androidx.paging.PagedList.Config,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))(
    config: PagedList.Config,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor()
): LiveData<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> 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/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/androidx/paging/LivePagedListBuilder`.

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

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

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

### DataSource.Factory.toLiveData

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toLiveData](https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toLiveData(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,java.util.concurrent.Executor))(
    pageSize: Int,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor()
): LiveData<PagedList<Value>>
```

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

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

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

| Parameters |
|---|---|
| `pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Page size. |
| `initialLoadKey: Key? = null` | Initial load key passed to the first `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` / `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. |
| `boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>? = null` | The boundary callback for listening to `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` load state. |
| `fetchExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html = ArchTaskExecutor.getIOThreadExecutor()` | Executor for fetching data from DataSources. |

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

### DataSource.Factory.toFlowable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))(
    config: PagedList.Config,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null,
    backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST
): Flowable<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> 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/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

### DataSource.Factory.toFlowable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))(
    config: PagedList.Config,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null,
    backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST
): Flowable<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> 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/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

### DataSource.Factory.toFlowable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))(
    pageSize: Int,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null,
    backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST
): Flowable<PagedList<Value>>
```

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

Constructs a `Flowable<PagedList>`, from this `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

### DataSource.Factory.toFlowable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toFlowable](https://developer.android.com/reference/kotlin/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))(
    pageSize: Int,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null,
    backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST
): Flowable<PagedList<Value>>
```

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

Constructs a `Flowable<PagedList>`, from this `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Page size. |
| `initialLoadKey: Key? = null` | Initial load key passed to the first `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` / `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`. |
| `boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>? = null` | The boundary callback for listening to `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` load state. |
| `fetchScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html? = null` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` used to fetch from `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`s, generally a background thread pool for e.g. I/O or network loading. |
| `notifyScheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html? = null` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` that receives `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI / main thread. |
| `backpressureStrategy: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html = BackpressureStrategy.LATEST` | `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/kotlin/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/kotlin/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)` |   |

### DataSource.Factory.toObservable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/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))(
    config: PagedList.Config,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null
): Observable<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> 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/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/rxjava3/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/kotlin/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)` |   |

### DataSource.Factory.toObservable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/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))(
    config: PagedList.Config,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null
): Observable<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> 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/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/kotlin/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)` |   |

### DataSource.Factory.toObservable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/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))(
    pageSize: Int,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null
): Observable<PagedList<Value>>
```

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

Constructs a `Observable<PagedList>` from this `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/rxjava3/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/kotlin/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)` |   |

### DataSource.Factory.toObservable

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

```
fun <Key : Any, Value : Any> DataSource.Factory<Key, Value>.[toObservable](https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory#(androidx.paging.DataSource.Factory).toObservable(kotlin.Int,kotlin.Any,androidx.paging.PagedList.BoundaryCallback,io.reactivex.Scheduler,io.reactivex.Scheduler))(
    pageSize: Int,
    initialLoadKey: Key? = null,
    boundaryCallback: PagedList.BoundaryCallback<Value>? = null,
    fetchScheduler: Scheduler? = null,
    notifyScheduler: Scheduler? = null
): Observable<PagedList<Value>>
```

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

Constructs a `Observable<PagedList>` from this `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory`, convenience for `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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/kotlin/androidx/paging/PagedList`s, as well as their updates to that scheduler.

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder` |   |
| `https://developer.android.com/reference/kotlin/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)` |   |