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

throttleWithTimeout

[androidJvm]
Content
fun <T> LiveData<T>.throttleWithTimeout(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.

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

Example:

val isLoadingLiveData: LiveData = ... val isLoadingThrottledLiveData: LiveData = isLoadingLiveData.throttleWithTimeout( timeInMillis = 1000L, context = viewModelScope.coroutineContext )