Skip to content

Instantly share code, notes, and snippets.

@dshen6
Created March 12, 2018 05:18
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 dshen6/495fa0d0adfb840c663765bf051bd420 to your computer and use it in GitHub Desktop.
Save dshen6/495fa0d0adfb840c663765bf051bd420 to your computer and use it in GitHub Desktop.
Android ViewState
sealed class ViewState<T> {
class Init<T>: ViewState<T>()
class Error<T>: ViewState<T>()
class Empty<T>: ViewState<T>()
class Loading<T>: ViewState<T>()
class DataReady<T>(val data : T): ViewState<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment