INNER CODE UNIT · Kotlin
ComputableLiveData
M66B/FairEmail · app/src/main/java/androidx/lifecycle/ComputableLiveData.kt:36
public abstract class ComputableLiveData<T>
@JvmOverloads
/**
* Creates a computable live data that computes values on the specified executor or the arch IO
* thread executor by default.
*
* @param executor Executor that is used to compute new LiveData values.
*/
constructor(internal val executor: Executor = ArchTaskExecutor.getIOThreadExecutor()) {
private val _liveData: LiveData<T?> =
object : LiveData<T?>() {
override fun onActive() {
executor.execute(refreshRunnable)
}
}
/** The LiveData managed by this class. */
public open val liveData: LiveData<T?> = _liveData