Last active
January 9, 2018 01:08
-
-
Save scottroemeschke/fbffc52401f3434e34f9aba5193047d6 to your computer and use it in GitHub Desktop.
part of conversation: https://www.reddit.com/r/androiddev/comments/7owabf/reactive_apps_architecture_design_asymnetry_that/
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
//bad | |
interface ShoppingCart { | |
fun observe(): Observable<ShoppingCart> | |
fun setShoppingCart(cart: ShoppingCart) | |
} | |
//good | |
interface ShoppingCart { | |
fun observe(): Observable<ShoppingCart> | |
//these all update the public state, and return results (failures, successes, relevant info) | |
fun clearAllProducts(): ClearProductsResult | |
fun addProduct(): AddProductResult | |
fun removeAllProductsOfCategory(category: String): ProductsRemovedResult | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment