Skip to content

Instantly share code, notes, and snippets.

@ahmedrizwan
Created August 25, 2019 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedrizwan/eadb76b023de1bf44b0745a4a9fcf040 to your computer and use it in GitHub Desktop.
Save ahmedrizwan/eadb76b023de1bf44b0745a4a9fcf040 to your computer and use it in GitHub Desktop.
sealed class UIState<out R> {
object Loading : UIState<Nothing>()
object Retrying : UIState<Nothing>()
object SwipeRefreshing : UIState<Nothing>()
data class Success<T>(val data: T) : UIState<T>()
data class Failure(val exception: Exception) : UIState<Nothing>()
data class SwipeRefreshFailure(val exception: Exception) : UIState<Nothing>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment