# Pager

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

*** ** * ** ***


```
public final class Pager<Key extends Object, Value extends Object>
```

<br />

*** ** * ** ***

Primary entry point into Paging; constructor for a reactive stream of `https://developer.android.com/reference/androidx/paging/PagingData`. The same Pager instance should be reused within an instance of ViewModel. For example in your ViewModel:

```
// create a Pager instance and store to a variable
val pager = Pager(
     ...
     )
     .flow
     .cachedIn(viewModelScope)
```

Each `https://developer.android.com/reference/androidx/paging/PagingData` represents a snapshot of the backing paginated data. Updates to the backing dataset should be represented by a new instance of `https://developer.android.com/reference/androidx/paging/PagingData`.

`https://developer.android.com/reference/androidx/paging/PagingSource#invalidate()` and calls to AsyncPagingDataDiffer.refresh or PagingDataAdapter.refresh will notify `https://developer.android.com/reference/androidx/paging/Pager` that the backing dataset has been updated and a new `https://developer.android.com/reference/androidx/paging/PagingData` / `https://developer.android.com/reference/androidx/paging/PagingSource` pair will be generated to represent an updated snapshot.

`https://developer.android.com/reference/androidx/paging/PagingData` can be transformed to alter data as it loads, and presented in a `RecyclerView` via `AsyncPagingDataDiffer` or `PagingDataAdapter`.

LiveData support is available as an extension property provided by the `androidx.paging:paging-runtime` artifact.

RxJava support is available as extension properties provided by the `androidx.paging:paging-rxjava2` artifact.

## 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/Pager#Pager(androidx.paging.PagingConfig,kotlin.Any,kotlin.Function0)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingConfig config, Key initialKey, @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>> pagingSourceFactory )` |
| `@https://developer.android.com/reference/androidx/paging/ExperimentalPagingApi <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/Pager#Pager(androidx.paging.PagingConfig,kotlin.Any,androidx.paging.RemoteMediator,kotlin.Function0)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingConfig config, Key initialKey, https://developer.android.com/reference/androidx/paging/RemoteMediator<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> remoteMediator, @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>> pagingSourceFactory )` |

| ### Public methods |
|---|---|
| `final void` | `https://developer.android.com/reference/androidx/paging/Pager#append()()` Loads a page at the end of current loaded data. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingData<@https://developer.android.com/reference/androidx/annotation/NonNull Value>>` | `https://developer.android.com/reference/androidx/paging/Pager#getFlow()()` A cold `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which emits new instances of `https://developer.android.com/reference/androidx/paging/PagingData` once they become invalidated by `https://developer.android.com/reference/androidx/paging/PagingSource#invalidate()` or calls to AsyncPagingDataDiffer.refresh or PagingDataAdapter.refresh. |
| `final void` | `https://developer.android.com/reference/androidx/paging/Pager#prepend()()` Loads a page at the start of current loaded data. |
| `final void` | `https://developer.android.com/reference/androidx/paging/Pager#refresh()()` Refresh all currently loaded data. |
| `final void` | `https://developer.android.com/reference/androidx/paging/Pager#refresh(kotlin.Any)(@https://developer.android.com/reference/androidx/annotation/NonNull Value item)` Refresh based on a given loaded item. |
| `final void` | `https://developer.android.com/reference/androidx/paging/Pager#retry()()` Retry most recent load that returned `https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Error`. |

| ### 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/PagingData<@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/PagingLiveData.https://developer.android.com/reference/androidx/paging/Pager#(androidx.paging.Pager).getLiveData()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/Pager<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver )` A `https://developer.android.com/reference/androidx/lifecycle/LiveData` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as a `https://developer.android.com/reference/androidx/lifecycle/LiveData`. |
| `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/PagingData<@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/PagingRx.https://developer.android.com/reference/androidx/paging/Pager#(androidx.paging.Pager).getFlowable()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/Pager<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver )` A `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as a `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html`. |
| `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/PagingData<@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/PagingRx.https://developer.android.com/reference/androidx/paging/Pager#(androidx.paging.Pager).getFlowable()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/Pager<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver )` A `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html`. |
| `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/PagingData<@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/PagingRx.https://developer.android.com/reference/androidx/paging/Pager#(androidx.paging.Pager).getObservable()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/Pager<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver )` An `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as an `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html`. |
| `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/PagingData<@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/PagingRx.https://developer.android.com/reference/androidx/paging/Pager#(androidx.paging.Pager).getObservable()( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/Pager<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> receiver )` An `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as an `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html`. |

## Public constructors

### Pager

```
public <Key extends Object, Value extends Object> Pager(
    @NonNull PagingConfig config,
    Key initialKey,
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory
)
```

### Pager

```
@ExperimentalPagingApi
public <Key extends Object, Value extends Object> Pager(
    @NonNull PagingConfig config,
    Key initialKey,
    RemoteMediator<@NonNull Key, @NonNull Value> remoteMediator,
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory
)
```

## Public methods

### append

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

```
public final void append()
```

Loads a page at the end of current loaded data. Provides a way to manually trigger appends without scrolling.

This function is no-op if there are no more data to be loaded from the datasource (i.e. append is `https://developer.android.com/reference/androidx/paging/LoadState.NotLoading.Companion#Complete()`)

Appends that are triggered by scrolling (i.e. if user scrolls to end of the list and triggers `https://developer.android.com/reference/androidx/paging/PagingConfig#prefetchDistance()`) takes precedence over this append. This ensures that items that are currently accessed gets loaded in first.

No-op if preceding `https://developer.android.com/reference/androidx/paging/Pager#append()` returned `https://developer.android.com/reference/androidx/paging/LoadState.Error`. To recover from error, use `https://developer.android.com/reference/androidx/paging/Pager#retry()`

```kotlin
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.Text
import androidx.compose.runtime.LaunchedEffect
import androidx.lifecycle.ViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.paging.Pager

val viewModel = viewModel { PagerViewModel() }

// collect on Pager
val itemsFlow = viewModel.snapshotListFlow.collectAsStateWithLifecycle()
val items: List<SampleData.Item> = itemsFlow.value.items

LazyColumn {
    item {
        /**
         * Load more items when users scroll near the top of loaded items.
         *
         * This example uses `viewModel` as the LaunchedEffect key to ensure that `prepend` is
         * only triggered once per scroll to the top. **Important** This assumes that `prepend`
         * loads enough new data to push this item composition out of the screen and LazyList
         * prefetch scope.
         */
        LaunchedEffect(viewModel) { viewModel.prepend() }
    }
    items(items) { item -> Text("Item: $item") }
    item {
        /**
         * Load more items when users scroll near the bottom of loaded items.
         *
         * This example uses `viewModel` as the LaunchedEffect key to ensure that `append` is
         * only triggered once per scroll to the bottom. **Important** This assumes that
         * `append` loads enough new data to push this item composition out of the screen and
         * LazyList prefetch scope.
         */
        LaunchedEffect(viewModel) { viewModel.append() }
    }
}
```

### getFlow

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

```
public final @NonNull Flow<@NonNull PagingData<@NonNull Value>> getFlow()
```

A cold `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which emits new instances of `https://developer.android.com/reference/androidx/paging/PagingData` once they become invalidated by `https://developer.android.com/reference/androidx/paging/PagingSource#invalidate()` or calls to AsyncPagingDataDiffer.refresh or PagingDataAdapter.refresh.

To consume this stream as a LiveData or in Rx, you may use the extensions available in the paging-runtime or paging-rxjava\* artifacts.

NOTE: Instances of `https://developer.android.com/reference/androidx/paging/PagingData` emitted by this `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` are not re-usable and cannot be submitted multiple times. This is especially relevant for transforms such as `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/index.html`, which would replay the latest value downstream. To ensure you get a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` for each downstream observer, you should use the `https://developer.android.com/reference/androidx/paging/package-summary#(kotlinx.coroutines.flow.Flow).cachedIn(kotlinx.coroutines.CoroutineScope)` operator which multicasts the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` in a way that returns a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` with cached data pre-loaded.

### prepend

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

```
public final void prepend()
```

Loads a page at the start of current loaded data. Provides a way to manually trigger prepends without scrolling.

This function is no-op if there are no more data to be loaded from the datasource (i.e. prepend is `https://developer.android.com/reference/androidx/paging/LoadState.NotLoading.Companion#Complete()`)

Prepends that are triggered by scrolling (i.e. if user scrolls to start of the list and triggers `https://developer.android.com/reference/androidx/paging/PagingConfig#prefetchDistance()`) takes precedence over this prepend. This ensures that items that are currently accessed gets loaded in first.

No-op if preceding `https://developer.android.com/reference/androidx/paging/Pager#prepend()` returned `https://developer.android.com/reference/androidx/paging/LoadState.Error`. To recover from error, use `https://developer.android.com/reference/androidx/paging/Pager#retry()`

```kotlin
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.Text
import androidx.compose.runtime.LaunchedEffect
import androidx.lifecycle.ViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.paging.Pager

val viewModel = viewModel { PagerViewModel() }

// collect on Pager
val itemsFlow = viewModel.snapshotListFlow.collectAsStateWithLifecycle()
val items: List<SampleData.Item> = itemsFlow.value.items

LazyColumn {
    item {
        /**
         * Load more items when users scroll near the top of loaded items.
         *
         * This example uses `viewModel` as the LaunchedEffect key to ensure that `prepend` is
         * only triggered once per scroll to the top. **Important** This assumes that `prepend`
         * loads enough new data to push this item composition out of the screen and LazyList
         * prefetch scope.
         */
        LaunchedEffect(viewModel) { viewModel.prepend() }
    }
    items(items) { item -> Text("Item: $item") }
    item {
        /**
         * Load more items when users scroll near the bottom of loaded items.
         *
         * This example uses `viewModel` as the LaunchedEffect key to ensure that `append` is
         * only triggered once per scroll to the bottom. **Important** This assumes that
         * `append` loads enough new data to push this item composition out of the screen and
         * LazyList prefetch scope.
         */
        LaunchedEffect(viewModel) { viewModel.append() }
    }
}
```

### refresh

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

```
public final void refresh()
```

Refresh all currently loaded data.

The refresh key is the key that was used to load the current first loaded page, and the loadSize is the size of current loaded data.

Note that this is a best-effort attempt to reload all current data. Actual loaded data may differ based on how `https://developer.android.com/reference/androidx/paging/PagingSource#load(androidx.paging.PagingSource.LoadParams)` handles the same key for different `https://developer.android.com/reference/androidx/paging/LoadType`. For example the current first page might have been a prepended page, and `https://developer.android.com/reference/androidx/paging/PagingSource#load(androidx.paging.PagingSource.LoadParams)` could handle the same key in different ways for `https://developer.android.com/reference/androidx/paging/LoadType#PREPEND` versus `https://developer.android.com/reference/androidx/paging/LoadType#REFRESH`

### refresh

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

```
public final void refresh(@NonNull Value item)
```

Refresh based on a given loaded item.

The refresh key is the key that was originally used to the load the page that contains `https://developer.android.com/reference/androidx/paging/Pager#refresh(kotlin.Any)`, and the loadSize is `https://developer.android.com/reference/androidx/paging/PagingConfig#initialLoadSize()`.

Note that this is a best-effort attempt to reload around the given loaded item. The requested `https://developer.android.com/reference/androidx/paging/Pager#refresh(kotlin.Any)` is expected to be in the first page of reloaded items but will likely not be the very first reloaded item. For example if two pages are currently loaded with loadKeys `MyKey1` and `MyKey2` respectively:

- pg1: MyKey1 = items 0, 1, 2, 3

- pg2: MyKey2 = items 4, 5, 6, 7 If this method were called with item 5 - refresh(5) - then the refreshKey will be `MyKey2`, which will theoretically refresh starting at (item 4) until (item4 + initialLoadSize).

### retry

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

```
public final void retry()
```

Retry most recent load that returned `https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Error`. No-op if there were no errors.

Applicable to all `https://developer.android.com/reference/androidx/paging/LoadType`s. The retry is not guaranteed to succeed as the cause of the initial may persist on retries.

## Extension functions

### PagingLiveData.getLiveData

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

```
public final @NonNull LiveData<@NonNull PagingData<@NonNull Value>> <Key extends Object, Value extends Object> PagingLiveData.getLiveData(
    @NonNull Pager<@NonNull Key, @NonNull Value> receiver
)
```

A `https://developer.android.com/reference/androidx/lifecycle/LiveData` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as a `https://developer.android.com/reference/androidx/lifecycle/LiveData`.

NOTE: Instances of `https://developer.android.com/reference/androidx/paging/PagingData` emitted by this `https://developer.android.com/reference/androidx/lifecycle/LiveData` are not re-usable and cannot be submitted multiple times. This is especially relevant because `https://developer.android.com/reference/androidx/lifecycle/LiveData` will replays the latest value downstream. To ensure you get a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` for each downstream observer, you should use the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.lifecycle.LiveData).cachedIn(androidx.lifecycle.Lifecycle)` operator which multicasts the `https://developer.android.com/reference/androidx/lifecycle/LiveData` in a way that returns a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` with cached data pre-loaded.

### PagingRx.getFlowable

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

```
public final @NonNull Flowable<@NonNull PagingData<@NonNull Value>> <Key extends Object, Value extends Object> PagingRx.getFlowable(
    @NonNull Pager<@NonNull Key, @NonNull Value> receiver
)
```

A `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as a `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html`.

NOTE: Instances of `https://developer.android.com/reference/androidx/paging/PagingData` emitted by this `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` are not re-usable and cannot be submitted multiple times. This is especially relevant for transforms, which would replay the latest value downstream. To ensure you get a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` for each downstream observer, you should use the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.lifecycle.LiveData).cachedIn(androidx.lifecycle.Lifecycle)` operator which multicasts the `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html` in a way that returns a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` with cached data pre-loaded.

### PagingRx.getFlowable

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

```
public final @NonNull Flowable<@NonNull PagingData<@NonNull Value>> <Key extends Object, Value extends Object> PagingRx.getFlowable(
    @NonNull Pager<@NonNull Key, @NonNull Value> receiver
)
```

A `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html`.

NOTE: Instances of `https://developer.android.com/reference/androidx/paging/PagingData` emitted by this `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` are not re-usable and cannot be submitted multiple times. This is especially relevant for transforms, which would replay the latest value downstream. To ensure you get a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` for each downstream observer, you should use the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.lifecycle.LiveData).cachedIn(androidx.lifecycle.Lifecycle)` operator which multicasts the `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Flowable.html` in a way that returns a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` with cached data pre-loaded.

### PagingRx.getObservable

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

```
public final @NonNull Observable<@NonNull PagingData<@NonNull Value>> <Key extends Object, Value extends Object> PagingRx.getObservable(
    @NonNull Pager<@NonNull Key, @NonNull Value> receiver
)
```

An `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as an `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html`.

NOTE: Instances of `https://developer.android.com/reference/androidx/paging/PagingData` emitted by this `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` are not re-usable and cannot be submitted multiple times. This is especially relevant for transforms, which would replay the latest value downstream. To ensure you get a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` for each downstream observer, you should use the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.lifecycle.LiveData).cachedIn(androidx.lifecycle.Lifecycle)` operator which multicasts the `https://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html` in a way that returns a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` with cached data pre-loaded.

### PagingRx.getObservable

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

```
public final @NonNull Observable<@NonNull PagingData<@NonNull Value>> <Key extends Object, Value extends Object> PagingRx.getObservable(
    @NonNull Pager<@NonNull Key, @NonNull Value> receiver
)
```

An `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` of `https://developer.android.com/reference/androidx/paging/PagingData`, which mirrors the stream provided by `https://developer.android.com/reference/androidx/paging/Pager#flow()`, but exposes it as an `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html`.

NOTE: Instances of `https://developer.android.com/reference/androidx/paging/PagingData` emitted by this `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` are not re-usable and cannot be submitted multiple times. This is especially relevant for transforms, which would replay the latest value downstream. To ensure you get a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` for each downstream observer, you should use the `https://developer.android.com/reference/androidx/paging/package-summary#(androidx.lifecycle.LiveData).cachedIn(androidx.lifecycle.Lifecycle)` operator which multicasts the `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Observable.html` in a way that returns a new instance of `https://developer.android.com/reference/androidx/paging/PagingData` with cached data pre-loaded.