Last active
July 5, 2019 00:48
-
-
Save agustarc/27bbdab852dae5f25e0caeea04ab7e1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchViewModel(private val api: SearchAPI, private val dao: BookmarkDao) : DisposableViewModel() { | |
private var query: String = "" | |
get() = if (field.isEmpty()) "MVVM" else field | |
private val _refreshing: NotNullMutableLiveData<Boolean> = NotNullMutableLiveData(false) | |
val refreshing: LiveData<Boolean> | |
get() = _refreshing | |
private val _items: NotNullMutableLiveData<List<Repository>> = NotNullMutableLiveData(arrayListOf()) | |
val items: LiveData<List<Repository>> | |
get() = _items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment