{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

InvalidatingPagingSourceFactory

{% setvar page_path %}androidx/paging/InvalidatingPagingSourceFactory.html{% endsetvar %} {% setvar can_switch %}1{% endsetvar %} {% include "reference/_kotlin_switcher2.md" %}

class InvalidatingPagingSourceFactory<Key : Any, Value : Any>


Wrapper class for PagingSource factory intended for usage in Pager construction. Stores reference to the PagingSource factory and the PagingSources it produces for invalidation when the backing dataset is updated.

Calling invalidate on this InvalidatingPagingSourceFactory will automatically forward invalidate signals to all active PagingSources.

Summary

Public constructors

<Key : Any, Value : Any> InvalidatingPagingSourceFactory(
    pagingSourceFactory: () -> PagingSource<Key, Value>
)

Public functions

Unit

Calls PagingSource.invalidate on each PagingSource that was produced by this InvalidatingPagingSourceFactory

open operator PagingSource<Key, Value>

Public constructors

InvalidatingPagingSourceFactory

<Key : Any, Value : Any> InvalidatingPagingSourceFactory(
    pagingSourceFactory: () -> PagingSource<Key, Value>
)
Parameters
pagingSourceFactory: () -> PagingSource<Key, Value>

The PagingSource factory that returns a PagingSource when called

Public functions

invalidate

fun invalidate(): Unit

Calls PagingSource.invalidate on each PagingSource that was produced by this InvalidatingPagingSourceFactory

invoke

open operator fun invoke(): PagingSource<Key, Value>
Returns
PagingSource<Key, Value>

PagingSource which will be invalidated when this factory's invalidate method is called