Skip to content

Instantly share code, notes, and snippets.

@ChristopherME
Last active May 7, 2021 01:56
Show Gist options
  • Save ChristopherME/508ede7590a8ff385498c80c861f741b to your computer and use it in GitHub Desktop.
Save ChristopherME/508ede7590a8ff385498c80c861f741b to your computer and use it in GitHub Desktop.
Holds the state of the MovieListFragment.
/**
* Represents the state to render the UI in MovieListFragment.
*
* @param isLoading if true we have to show a progress bar, else hide the progress bar.
* @param movies this list will be submited into recyclerview adapter.
* @param error OneTimeEvent that wraps a failure object for display a Toast, Snackbar, etc only once.
*/
data class MovieListUiState(
val isLoading: Boolean = false,
val movies: List<MovieUi> = emptyList(),
val error: OneTimeEvent<Failure>? = null
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment