Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created June 27, 2024 15:38
Show Gist options
  • Save anitaa1990/63856c2d2af9b383def67e9dff82c7a7 to your computer and use it in GitHub Desktop.
Save anitaa1990/63856c2d2af9b383def67e9dff82c7a7 to your computer and use it in GitHub Desktop.
data class ContactUiState(
val loading: Boolean = false,
val contacts: GroupedContacts = Collections.emptyMap()
)
/**
* Type aliases provide alternative names for existing types.
* If the type name is too long you can introduce a different shorter name
* and use the new one instead. In this example, we've created a typealias
* for `ContactModel` to convert it into a Map which includes the alphabets
* as the key and the list of `ContactModel` as the values of the Map.
*/
typealias GroupedContacts = Map<String, List<ContactModel>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment