Skip to content

Instantly share code, notes, and snippets.

@shredderskelton
Created April 13, 2021 14:59
Show Gist options
  • Select an option

  • Save shredderskelton/2468a4486a2ae44e20d1c2698ffe2847 to your computer and use it in GitHub Desktop.

Select an option

Save shredderskelton/2468a4486a2ae44e20d1c2698ffe2847 to your computer and use it in GitHub Desktop.
Result
sealed class MyResult<T> {
sealed class Success<T>(val data: T) : MyResult<T>() {
class Network<T>(data: T) : Success<T>(data)
class Cache<T>(data: T) : Success<T>(data)
}
data class Failure<T>(val error: String) : MyResult<T>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment