Created
November 21, 2016 21:05
-
-
Save LewisRhine/f19c5af27049ac6432be695c24fffd64 to your computer and use it in GitHub Desktop.
Example Nearby Restaurant State Tree
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
sealed class RestaurantNearby() { | |
sealed class Loading() : RestaurantNearby() { | |
//Code for getting Location, and API call | |
sealed class Done() : Loading() { | |
fun reloadData() {} | |
class Ready(val restaurants: List<Restaurant>) : Done() | |
class Empty() : Done() | |
class Error(val message: String, val throwable: Throwable?) : Done() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment