-
-
Save tw-Frey/380ce79ac88a7d5b4a3a708520012909 to your computer and use it in GitHub Desktop.
This file contains 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
/* Copyright 2020 Seanghay Yath (@seanghay) | |
SPDX-License-Identifier: Apache-2.0 */ | |
sealed class ResultOf<out T> { | |
data class Success<out R>(val value: R): ResultOf<R>() | |
data class Failure( | |
val message: String?, | |
val throwable: Throwable? | |
): ResultOf<Nothing>() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://medium.com/swlh/kotlin-sealed-class-for-success-and-error-handling-d3054bef0d4e