first

fun <P : IviPagingSource<E>, E : Any> Flow<P>.first(): Flow<E>

Transforms this IviPagingSource to a E with only the first element from the IviPagingSource.


fun <P : IviPagingSource<E>, E : Any> LiveData<P>.first(timeout: Duration = Duration.ZERO): LiveData<E>

Transforms this IviPagingSource to a E with only the first element from the IviPagingSource. If the returned LiveData becomes inactive while values are still being emitted, the underlying coroutine will be cancelled after the timeout, unless the LiveData becomes active again before that timeout. By default, timeout is Duration.ZERO, which means that once the returned LiveData becomes inactive it is not usable anymore.