# PagerFlowSnapshotKt

Added in 3.2.0

*** ** * ** ***


```
public final class PagerFlowSnapshotKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull Value>` | `@https://developer.android.com/reference/androidx/annotation/VisibleForTesting <Value extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/paging/testing/PagerFlowSnapshotKt#(kotlinx.coroutines.flow.Flow).asSnapshot(androidx.paging.testing.LoadErrorHandler,kotlin.coroutines.SuspendFunction1)( @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>> receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/testing/LoadErrorHandler onError, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/testing/SnapshotLoader<@https://developer.android.com/reference/androidx/annotation/NonNull Value>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> loadOperations )` Runs the `https://developer.android.com/reference/androidx/paging/testing/SnapshotLoader` load operations that are passed in and returns a List of data that would be presented to the UI after all load operations are complete. |

## Public methods

### asSnapshot

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

```
@VisibleForTesting
public static final @NonNull List<@NonNull Value> <Value extends Object> asSnapshot(
    @NonNull Flow<@NonNull PagingData<@NonNull Value>> receiver,
    @NonNull LoadErrorHandler onError,
    @NonNull SuspendFunction1<@NonNull SnapshotLoader<@NonNull Value>, Unit> loadOperations
)
```

Runs the `https://developer.android.com/reference/androidx/paging/testing/SnapshotLoader` load operations that are passed in and returns a List of data that would be presented to the UI after all load operations are complete.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/testing/LoadErrorHandler onError` | The error recovery strategy when PagingSource returns LoadResult.Error. A lambda that returns an `https://developer.android.com/reference/androidx/paging/testing/ErrorRecovery` value. The default strategy is `https://developer.android.com/reference/androidx/paging/testing/ErrorRecovery#THROW`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/testing/SnapshotLoader<@https://developer.android.com/reference/androidx/annotation/NonNull Value>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> loadOperations` | The block containing `https://developer.android.com/reference/androidx/paging/testing/SnapshotLoader` load operations. |