Last active
May 30, 2022 16:24
-
-
Save abdulhafizramadan-ittp/d2d2d763f24a87d1aaafb8c63bd291a6 to your computer and use it in GitHub Desktop.
Android | Result Wrapper
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
| package com.ahr.newsapp.data | |
| sealed class Result<out R> private constructor() { | |
| data class Success<out T>(val data: T) : Result<T>() | |
| data class Error(val error: String) : Result<Nothing>() | |
| object Loading : Result<Nothing>() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment