Hi,
This is not an issue but a question. There is no other way to ask a question.
Why you did not use an MediatorLiveData instead of observing 3 differents LiveData like you do:
viewModel.isLoadingLiveData.observe(this, Observer<Boolean> { it?.let { vRefresh.isRefreshing = it } })
viewModel.reposLiveData.observe(this, Observer<List<Repo>> { it?.let { adapter.dataSource = it } })
viewModel.throwableLiveData.observe(this, Observer<Throwable> { it?.let { Snackbar.make(rv, it.localizedMessage, Snackbar.LENGTH_LONG).show() } }).
You could add those 3 different source inside the mediatorLiveData and thus observing one livedata in the your activity/fragment.
Hi,
This is not an issue but a question. There is no other way to ask a question.
Why you did not use an MediatorLiveData instead of observing 3 differents LiveData like you do:
viewModel.isLoadingLiveData.observe(this, Observer<Boolean> { it?.let { vRefresh.isRefreshing = it } })viewModel.reposLiveData.observe(this, Observer<List<Repo>> { it?.let { adapter.dataSource = it } })viewModel.throwableLiveData.observe(this, Observer<Throwable> { it?.let { Snackbar.make(rv, it.localizedMessage, Snackbar.LENGTH_LONG).show() } }).You could add those 3 different source inside the mediatorLiveData and thus observing one livedata in the your activity/fragment.