# PagingSource.LoadResult.Invalid

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

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  class PagingSource.LoadResult.Invalid<Key : Any, Value : Any> : PagingSource.LoadResult<Key, Value>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.paging.PagingSource.LoadResult](https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult)\<Key, Value\> ||
|   | ↳ | [androidx.paging.PagingSource.LoadResult.Invalid](https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Invalid) |

*** ** * ** ***

Invalid result object for `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource#load(androidx.paging.PagingSource.LoadParams)`

This return type can be used to terminate future load requests on this `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` when the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` is not longer valid due to changes in the underlying dataset.

For example, if the underlying database gets written into but the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` does not invalidate in time, it may return inconsistent results if its implementation depends on the immutability of the backing dataset it loads from (e.g., LIMIT OFFSET style db implementations). In this scenario, it is recommended to check for invalidation after loading and to return LoadResult.Invalid, which causes Paging to discard any pending or future load requests to this PagingSource and invalidate it.

Returning `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Invalid` will trigger Paging to `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource#invalidate()` this `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` and terminate any future attempts to `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource#load(androidx.paging.PagingSource.LoadParams)` from this `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`

## 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/PagingSource.LoadResult.Invalid#Invalid()()` | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Invalid#toString()()` | Cmn |

## Public constructors

### Invalid

Cmn

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

## Public functions

### toString

Cmn

```
open fun toString(): String
```