//Extensions for Jetpack Lifecycle/it.czerwinski.android.lifecycle.livedata/delayStart

delayStart

[androidJvm]
Content
fun <T> LiveData<T>.delayStart(timeInMillis: Long, context: CoroutineContext = EmptyCoroutineContext): LiveData<T>
More info

Returns a LiveData emitting values from this LiveData, after dropping values followed by newer values before timeInMillis expires since the result LiveData has been created. The values emitted after timeInMillis are not affected.

Delay will be applied on a thread determined by the given context.

Example:

val resultLiveData: LiveData = ... val delayedResultLiveData: LiveData = resultLiveData.delayStart( timeInMillis = 1000L, context = viewModelScope.coroutineContext )