Created
June 6, 2021 09:44
-
-
Save annchar/f7c97a3030c8b7e12e71ce8b839ee117 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 CryptoListViewModel(private val repository: CryptoListRepository) : BaseViewModel() { | |
private val _cryptoList = MutableLiveData<PagingData<CryptoItemResponse>>() | |
suspend fun getCryptoList(): LiveData<PagingData<CryptoItemResponse>> { | |
val response = repository.getCryptoList().cachedIn(viewModelScope) | |
_cryptoList.value = response.value | |
return response | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment