Created
July 21, 2021 13:02
-
-
Save aasierra/8512768acc9550aae2e2d9b7c52020e6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Business logic center. | |
*/ | |
class ProductInfoBusinessLogicCenterViewModel: ViewModel() { | |
/** | |
* Observable object for the view to watch. | |
*/ | |
val productInfo = MutableLiveData<ProductInfoDisplay>() | |
init { | |
val fakeServerResponseObject = ServerObject(ServerProductInformation("Product Name", "$1,000,000", true)) | |
/** | |
* Grabbing only what the view needs to know about from the response. | |
*/ | |
productInfo.value = ProductInfoDisplay(fakeServerResponseObject.product.productName, fakeServerResponseObject.product.price) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment