Skip to content

Instantly share code, notes, and snippets.

@gumil
Created February 17, 2019 17:39
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 gumil/b696e668a6c3039aa0f2816c39fffe63 to your computer and use it in GitHub Desktop.
Save gumil/b696e668a6c3039aa0f2816c39fffe63 to your computer and use it in GitHub Desktop.
internal sealed class ListState : State {
data class Screen(
val giphies: List<GiphyItem> = emptyList(),
val loadingMode: Mode = Mode.IDLE_REFRESH
) : ListState()
data class Error(
val errorMessage: Int
) : ListState(), SingleEvent
data class GoToDetail(
val giphy: GiphyItem
) : ListState(), SingleEvent
enum class Mode {
REFRESH, LOAD_MORE, IDLE_REFRESH, IDLE_LOAD_MORE
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment