Skip to content

Instantly share code, notes, and snippets.

@gabriel-TheCode
Created June 22, 2021 16:06
Show Gist options
  • Select an option

  • Save gabriel-TheCode/6b960ffade2fbe59544afce9f8456c4a to your computer and use it in GitHub Desktop.

Select an option

Save gabriel-TheCode/6b960ffade2fbe59544afce9f8456c4a to your computer and use it in GitHub Desktop.
A utility class that will be responsible to communicate the current state of Network Call to the UI Layer
sealed class DataState<out R> {
data class Success<out T>(val data: T) : DataState<T>()
data class Error(val exception: Exception) : DataState<Nothing>()
object Loading : DataState<Nothing>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment