Skip to content

Instantly share code, notes, and snippets.

@Askeri-Muhendis
Last active August 14, 2022 11:09
Show Gist options
  • Save Askeri-Muhendis/9d3eaf1de9d5574df96fccbc2cb5595e to your computer and use it in GitHub Desktop.
Save Askeri-Muhendis/9d3eaf1de9d5574df96fccbc2cb5595e to your computer and use it in GitHub Desktop.
sealed_model
sealed class Resource<T>{
class Success<T>(val data : T) : Resource<T>()
class Error<T>(val errorCode : Int,val errorMessage : String) : Resource<T>()
class Exception<T>(val exception : Throwable) : Resource<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment