Base View Model
Base class representing ViewModel. It allows to observe LiveDatas, which is useful for observing ViewState. Observers are automatically removed when ViewModel is no longer used and will be destroyed. Beside that, it handles one-shot Events send from ViewModel to Activity/Fragment.
Constructors
Functions
Observe one-shot Event defined by event class and run observer lambda whenever event is received. This event class must be associated with current Activity/Fragment ViewState.
Observe LiveData without particular owner (Activity eg.). Observer is removed when ViewModel is destroyed.
Observe DefaultValueLiveData without particular owner (Activity eg.). Observer is removed when ViewModel is destroyed.
Observe DefaultValueMediatorLiveData without particular owner (Activity eg.). Observer is removed when ViewModel is destroyed.
Activity's onStart() method companion. Method is executed only once.