# InvalidatingPagingSourceFactory

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

*** ** * ** ***


```
public final class InvalidatingPagingSourceFactory<Key extends Object, Value extends Object> implements PagingSourceFactory<@NonNull Key, @NonNull Value>
```

<br />

*** ** * ** ***

Wrapper class for a `https://developer.android.com/reference/androidx/paging/PagingSource` factory intended for usage in `https://developer.android.com/reference/androidx/paging/Pager` construction.

Calling `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory#invalidate()` on this `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory` will forward invalidate signals to all active `https://developer.android.com/reference/androidx/paging/PagingSource`s that were produced by calling `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory#invoke()`.

This class is thread-safe for concurrent calls to any mutative operations including both `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory#invoke()` and `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory#invalidate()`.

## 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/InvalidatingPagingSourceFactory#InvalidatingPagingSourceFactory(kotlin.Function0)( @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/InvalidatingPagingSourceFactory#invalidate()()` Calls `https://developer.android.com/reference/androidx/paging/PagingSource#invalidate()` on each `https://developer.android.com/reference/androidx/paging/PagingSource` that was produced by this `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory` |
| `@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>` | `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory#invoke()()` |

## Public constructors

### InvalidatingPagingSourceFactory

```
public <Key extends Object, Value extends Object> InvalidatingPagingSourceFactory(
    @NonNull Function0<@NonNull PagingSource<@NonNull Key, @NonNull Value>> pagingSourceFactory
)
```

| Parameters |
|---|---|
| `@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` | The `https://developer.android.com/reference/androidx/paging/PagingSource` factory that returns a PagingSource when called |

## Public methods

### invalidate

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

```
public final void invalidate()
```

Calls `https://developer.android.com/reference/androidx/paging/PagingSource#invalidate()` on each `https://developer.android.com/reference/androidx/paging/PagingSource` that was produced by this `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory`

### invoke

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

```
public @NonNull PagingSource<@NonNull Key, @NonNull Value> invoke()
```

| Returns |
|---|---|
| `@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>` | `https://developer.android.com/reference/androidx/paging/PagingSource` which will be invalidated when this factory's `https://developer.android.com/reference/androidx/paging/InvalidatingPagingSourceFactory#invalidate()` method is called |