# RxPagedListBuilder

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

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- android

  ```
  class RxPagedListBuilder<Key : Any, Value : Any>
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Builder for `Observable<PagedList>` or `Flowable<PagedList>`, given a `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory` and a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config`.

The required parameters are in the constructor, so you can simply construct and build, or optionally enable extra features (such as initial load key, or BoundaryCallback).

The returned observable/flowable will already be subscribed on the `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setFetchScheduler(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/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler)`, and will dispatch new PagedLists, as well as their updates to that scheduler.

| Parameters |
|---|---|
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of input valued used to load data from the `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`. Must be integer if you're using `https://developer.android.com/reference/kotlin/androidx/paging/PositionalDataSource`. |
| `<Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Item type being presented. |

## 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> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(androidx.paging.DataSource.Factory,androidx.paging.PagedList.Config))( dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>, config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(androidx.paging.DataSource.Factory,kotlin.Int))( dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>, pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(kotlin.Function0,androidx.paging.PagedList.Config))( pagingSourceFactory: () -> https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>, config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(kotlin.Function0,kotlin.Int))( pagingSourceFactory: () -> https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>, pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |

| ### Public functions |
|---|---|---|
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `[buildFlowable](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#buildFlowable(io.reactivex.BackpressureStrategy))(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 |
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | `[buildObservable](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#buildObservable())()` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | `[setBoundaryCallback](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback))( boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>? )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | `[setFetchScheduler](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setFetchScheduler(io.reactivex.Scheduler))(scheduler: 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 |
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | `[setInitialLoadKey](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setInitialLoadKey(kotlin.Any))(key: Key?)` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | `[setNotifyScheduler](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler))(scheduler: 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

### RxPagedListBuilder

android

```
<Key : Any, Value : Any> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(androidx.paging.DataSource.Factory,androidx.paging.PagedList.Config))(
    dataSourceFactory: DataSource.Factory<Key, Value>,
    config: PagedList.Config
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> Pager(
>                 config = PagingConfig(
>                     config.pageSize,
>                     config.prefetchDistance,
>                     config.enablePlaceholders,
>                     config.initialLoadSizeHint,
>                     config.maxSize
>                 ),
>                 initialKey = null,
>                 pagingSourceFactory = dataSourceFactory.asPagingSourceFactory(Dispatchers.IO)
>             ).flowable
> ```

Creates a `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder` with required parameters.

| Parameters |
|---|---|
| `dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>` | DataSource factory providing DataSource generations. |
| `config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config` | Paging configuration. |

### RxPagedListBuilder

android

```
<Key : Any, Value : Any> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(androidx.paging.DataSource.Factory,kotlin.Int))(
    dataSourceFactory: DataSource.Factory<Key, Value>,
    pageSize: Int
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> Pager(
>                 config = PagingConfig(pageSize),
>                 initialKey = null,
>                 pagingSourceFactory = dataSourceFactory.asPagingSourceFactory(Dispatchers.IO)
>             ).flowable
> ```

Creates a `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder` with required parameters.

This method is a convenience for:

```kotlin
RxPagedListBuilder(
    dataSourceFactory,
    PagedList.Config.Builder().setPageSize(pageSize).build()
)
```

| Parameters |
|---|---|
| `dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/DataSource.Factory` providing DataSource generations. |
| `pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Size of pages to load. |

### RxPagedListBuilder

android

```
<Key : Any, Value : Any> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(kotlin.Function0,androidx.paging.PagedList.Config))(
    pagingSourceFactory: () -> PagingSource<Key, Value>,
    config: PagedList.Config
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> Pager(
>                 config = PagingConfig(
>                     config.pageSize,
>                     config.prefetchDistance,
>                     config.enablePlaceholders,
>                     config.initialLoadSizeHint,
>                     config.maxSize
>                 ),
>                 initialKey = null,
>                 pagingSourceFactory = pagingSourceFactory
>             ).flowable
> ```

Creates a `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder` with required parameters.

| Parameters |
|---|---|
| `pagingSourceFactory: () -> https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>` | DataSource factory providing DataSource generations. |
| `config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config` | Paging configuration. |

### RxPagedListBuilder

android

```
<Key : Any, Value : Any> [RxPagedListBuilder](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#RxPagedListBuilder(kotlin.Function0,kotlin.Int))(
    pagingSourceFactory: () -> PagingSource<Key, Value>,
    pageSize: Int
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, use this instead:
>
> ```kotlin
> Pager(
>                 config = PagingConfig(pageSize),
>                 initialKey = null,
>                 pagingSourceFactory = pagingSourceFactory
>             ).flowable
> ```

Creates a `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder` with required parameters.

This method is a convenience for:

```kotlin
RxPagedListBuilder(
    pagingSourceFactory,
    PagedList.Config.Builder().setPageSize(pageSize).build()
)
```

| Parameters |
|---|---|
| `pagingSourceFactory: () -> https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` factory providing `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` generations. |
| `pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Size of pages to load. |

## Public functions

### buildFlowable

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

```
fun [buildFlowable](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#buildFlowable(io.reactivex.BackpressureStrategy))(backpressureStrategy: BackpressureStrategy): Flowable<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Constructs a `Flowable<PagedList>`.

The returned Observable will already be observed on the `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#notifyScheduler()`, and subscribed on the `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#fetchScheduler()`.

| Parameters |
|---|---|
| `backpressureStrategy: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/BackpressureStrategy.html` | BackpressureStrategy for the `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` to use. |

| Returns |
|---|---|
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | The `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` of PagedLists |

### buildObservable

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

```
fun [buildObservable](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#buildObservable())(): Observable<PagedList<Value>>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Constructs a `Observable<PagedList>`.

The returned Observable will already be observed on the `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#notifyScheduler()`, and subscribed on the `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#fetchScheduler()`.

| Returns |
|---|---|
| `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html<https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>>` | The `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` of PagedLists |

### setBoundaryCallback

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

```
fun [setBoundaryCallback](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback))(
    boundaryCallback: PagedList.BoundaryCallback<Value>?
): RxPagedListBuilder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Sets a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback` on each PagedList created, typically used to load additional data from network when paging from local storage.

Pass a BoundaryCallback to listen to when the PagedList runs out of data to load. If this method is not called, or `null` is passed, you will not be notified when each DataSource runs out of data to provide to its PagedList.

If you are paging from a DataSource.Factory backed by local storage, you can set a BoundaryCallback to know when there is no more information to page from local storage. This is useful to page from the network when local storage is a cache of network data.

Note that when using a BoundaryCallback with a `Observable<PagedList>`, method calls on the callback may be dispatched multiple times - one for each PagedList/DataSource pair. If loading network data from a BoundaryCallback, you should prevent multiple dispatches of the same method from triggering multiple simultaneous network loads.

| Parameters |
|---|---|
| `boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?` | The boundary callback for listening to PagedList load state. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | this |

### setFetchScheduler

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

```
fun [setFetchScheduler](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setFetchScheduler(io.reactivex.Scheduler))(scheduler: Scheduler): RxPagedListBuilder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Sets scheduler which will be used for background fetching of PagedLists, as well as on-demand fetching of pages inside.

If not set, defaults to the Arch components I/O thread pool.

The built `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` / `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` will be subscribed on this scheduler.

| Parameters |
|---|---|
| `scheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` | `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` used to fetch from DataSources, generally a background thread pool for e.g. I/O or network loading. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | this |

### setInitialLoadKey

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

```
fun [setInitialLoadKey](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setInitialLoadKey(kotlin.Any))(key: Key?): RxPagedListBuilder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

First loading key passed to the first PagedList/DataSource.

When a new PagedList/DataSource pair is created after the first, it acquires a load key from the previous generation so that data is loaded around the position already being observed.

| Parameters |
|---|---|
| `key: Key?` | Initial load key passed to the first PagedList/DataSource. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | this |

### setNotifyScheduler

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

```
fun [setNotifyScheduler](https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler))(scheduler: Scheduler): RxPagedListBuilder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Sets scheduler which will be used for observing new PagedLists, as well as loading updates within the PagedLists.

If not set, defaults to the UI thread.

The built `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` / `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` will be observed on this scheduler, so that the thread receiving PagedLists will also receive the internal updates to the PagedList.

| Parameters |
|---|---|
| `scheduler: https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Scheduler.html` | Scheduler that receives PagedList updates, and where `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the UI/main thread. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/RxPagedListBuilder<Key, Value>` | this |