Skip to content

Instantly share code, notes, and snippets.

@Raiden18
Last active May 10, 2022 14:28
Show Gist options
  • Save Raiden18/ad207e231587ce15332e64bf38ad885b to your computer and use it in GitHub Desktop.
Save Raiden18/ad207e231587ce15332e64bf38ad885b to your computer and use it in GitHub Desktop.
Information Expert. ViewModel
class CartViewModel(
private val cartInteractor: CartInteractor
): ViewModel() {
private val approximatePriceOfProductsLiveData = MutableLiveData<String>()
init {
val cart = cartInteractor.getCart()
val approximatePriceOfProducts : BigDecimal = TODO("Must be calculated")
val approximatePriceOfProductsLiveData = approximatePriceOfProducts.toString()
}
fun getApproximatePriceOfProductsLiveData(): LiveData<String> {
return approximatePriceOfProductsLiveData
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment