Skip to content

Instantly share code, notes, and snippets.

@agustarc
Last active July 5, 2019 00:48
Show Gist options
  • Save agustarc/27bbdab852dae5f25e0caeea04ab7e1d to your computer and use it in GitHub Desktop.
Save agustarc/27bbdab852dae5f25e0caeea04ab7e1d to your computer and use it in GitHub Desktop.
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