Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Last active November 30, 2024 16:39
Show Gist options
  • Select an option

  • Save anitaa1990/3b18070d46510b09d264c9db87c771a8 to your computer and use it in GitHub Desktop.

Select an option

Save anitaa1990/3b18070d46510b09d264c9db87c771a8 to your computer and use it in GitHub Desktop.
/**
* A data class representing the UI state for displaying notes in the app.
* This class is used to encapsulate the state of the UI in a single immutable object.
* The immutable nature of the state guarantees that each update leads to a predictable
* UI change, helping prevent bugs and ensuring smooth interactions.
*
* @param isLoading Indicates whether the UI is currently in a loading state.
* @param notes A list of notes to display in the UI. Defaults to an empty list.
*/
data class NoteUiViewState(
val isLoading: Boolean = false,
val notes: List<Note> = emptyList()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment