Skip to content

Instantly share code, notes, and snippets.

@orcchg
Created June 26, 2021 08:06
Show Gist options
  • Select an option

  • Save orcchg/cbaa9dad8d6fb3e9e78b0bc9e728880d to your computer and use it in GitHub Desktop.

Select an option

Save orcchg/cbaa9dad8d6fb3e9e78b0bc9e728880d to your computer and use it in GitHub Desktop.
internal class StockListViewModel @Inject constructor(
private val interactor: StockListInteractor
) : ViewModel() {
private val _stocks by lazy {
val data = MutableLiveData<List<Stock>>()
interactor
.stocks()
.subscribe({ data.value = it }, Timber::e)
data
}
internal val stocks: LiveData<List<Stock>> by lazy { _stocks }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment