Created
June 22, 2021 16:06
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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