ConsistentLiveData

open class ConsistentLiveData<T>(initValue: T? = null) : LiveData<T> (source)

This is an atomic LiveData where you can do .value instantly after doing .postValue.

The default behavior is a footgun that will cause race conditions, as we do not really care if it is posted as we only want the latest data (even in the binding).

Fuck all that is LiveData, because we want this value to be accessible everywhere instantly.

Inheritors

Constructors

Link copied to clipboard
constructor(initValue: T? = null)

Properties

Link copied to clipboard
open override val isInitialized: Boolean
Link copied to clipboard

If someone want the old behavior then good for them

Link copied to clipboard
open override var value: T?

Functions

Link copied to clipboard
open override fun getValue(): T?
Link copied to clipboard
Link copied to clipboard
open fun hasObservers(): Boolean
Link copied to clipboard
open fun observe(owner: @NonNull LifecycleOwner, observer: @NonNull Observer<in T?>)
Link copied to clipboard
open fun observeForever(observer: @NonNull Observer<in T?>)
Link copied to clipboard
protected open fun onActive()
Link copied to clipboard
protected open fun onInactive()
Link copied to clipboard
open override fun postValue(value: T?)
Link copied to clipboard
open fun removeObserver(observer: @NonNull Observer<in T?>)
Link copied to clipboard
open fun removeObservers(owner: @NonNull LifecycleOwner)
Link copied to clipboard
open override fun setValue(value: T?)